/* ============================================================================
 * 183 PWA — header.css
 * Split from the original single-file PWA. See styles/README.md for the
 * full layout map.
 * ========================================================================== */



/* ============================================================================
   Bell + header actions
   ========================================================================== */

.app-header .header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bell-btn {
  position: relative;
}

.bell-count {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--signal);
  color: #1a1208;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-deepest);
  line-height: 1;
}



/* ============================================================================
   Ticker strip — PWA-037 polish (was: retro Bloomberg phosphor)
   Constant-velocity scrolling marquee. Uses theme tokens so light mode
   inherits automatically. The visual is now app-native: same mono
   typeface as the rest of the UI, no phosphor backing, subtle borders
   instead of hard contrasts. Sits under the header in the demo-banner
   slot.
   ========================================================================== */

.ticker-strip {
  position: relative;
  width: 100%;
  height: 28px;
  overflow: hidden;
  background: var(--bg-elevated);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 6px 0 8px 0;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.ticker-strip::before,
.ticker-strip::after {
  /* Edge fades using the same surface colour as the strip. Variable-
     bound so light-mode users get a light fade, dark-mode users
     get a dark fade — both subtle, both correct. */
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 24px;
  z-index: 2;
  pointer-events: none;
}
.ticker-strip::before {
  left: 0;
  background: linear-gradient(to right, var(--bg-elevated), transparent);
}
.ticker-strip::after {
  right: 0;
  background: linear-gradient(to left, var(--bg-elevated), transparent);
}

.ticker-track {
  display: inline-flex;
  align-items: center;
  height: 100%;
  white-space: nowrap;
  /* The track holds two copies of the items end-to-end; we translate -50%
     so the second copy slides into the slot the first copy vacates.
     PWA-037: 38s → 22s. The old speed was deliberately slow to feel
     terminal-ish; modern marquees scroll briskly so the eye doesn't
     glaze. */
  animation: ticker-scroll 22s linear infinite;
  will-change: transform;
}

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Pause on hover (desktop) and active (touch) — gives the user a chance
   to read mid-scroll. The tap that pauses also opens the panel. */
.ticker-strip:hover .ticker-track,
.ticker-strip:active .ticker-track {
  animation-play-state: paused;
}

.ticker-item {
  /* Use the app's mono token instead of the retro VT323 pixel font.
     Mono still fits the data-feed feel without looking tacky. */
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 0 4px;
  /* No more `font-smoothing: none` / pixel-render hints — those were
     for VT323. Now we want crisp anti-aliased mono. */
}

/* Severity colours use existing tokens so they retheme automatically.
   Each tone gets a soft text-shadow that lifts it from the strip
   without the heavy phosphor glow of the old style. */
.ticker-item-critical { color: var(--bad); }
.ticker-item-warn     { color: var(--signal); }
.ticker-item-info     { color: var(--accent); }
.ticker-item-ambient  { color: var(--text-muted); }

.ticker-sep {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.4;
  padding: 0;
  letter-spacing: 0.1em;
}

/* Strip-level severity tint — 1px coloured top border so the user's
   peripheral vision can register severity without reading the message.
   Tokens drive the colour; opacity dialled down so it doesn't shout. */
.ticker-strip.ticker-sev-critical { border-top-color: var(--bad); }
.ticker-strip.ticker-sev-warn     { border-top-color: var(--signal); }
.ticker-strip.ticker-sev-info     { border-top-color: var(--accent); }
.ticker-strip.ticker-sev-ambient  { border-top-color: var(--line-strong); }

/* Reduced-motion fallback — replace scroll with a frozen first-viewport
   view. User can tap the bell to read full panel. */
@media (prefers-reduced-motion: reduce) {
  .ticker-track {
    animation: none;
  }
}



/* ============================================================================
   Notification sheet
   Modern in keeping with the rest of the app — the retro register is
   confined to the ticker strip itself.
   ========================================================================== */

.notif-sheet-content {
  padding: 4px 0 24px 0;
}

.notif-sheet-content .sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px 16px 20px;
}

.notif-sheet-content .sheet-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 0.9rem;
  cursor: pointer;
}

.notif-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px;
}

.notif-row {
  display: flex;
  align-items: stretch;
  gap: 12px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 14px 14px 0;
  position: relative;
  overflow: hidden;
}

.notif-leader {
  width: 4px;
  flex-shrink: 0;
  align-self: stretch;
  margin-right: 0;
}

.notif-sev-critical .notif-leader { background: var(--fail); box-shadow: 0 0 8px rgba(255, 84, 112, 0.5); }
.notif-sev-warn     .notif-leader { background: var(--signal); box-shadow: 0 0 6px rgba(255, 184, 77, 0.4); }
.notif-sev-info     .notif-leader { background: var(--accent); box-shadow: 0 0 6px rgba(0, 224, 255, 0.35); }
.notif-sev-ambient  .notif-leader { background: var(--text-faint); }

.notif-body {
  flex: 1;
  min-width: 0;
}

.notif-title {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text);
  margin-bottom: 6px;
  word-break: break-word;
}

.notif-sev-critical .notif-title { color: var(--fail); }
.notif-sev-warn     .notif-title { color: var(--signal); }
.notif-sev-info     .notif-title { color: var(--accent); }
.notif-sev-ambient  .notif-title { color: var(--text-soft); }

.notif-text {
  font-family: var(--sans);
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text-soft);
  margin-bottom: 10px;
}

.notif-action {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 14px;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 140ms;
}

.notif-action:hover,
.notif-action:active {
  border-color: var(--accent);
  color: var(--accent);
}

/* PWA-040: when a notification has both a primary and secondary
   action, they sit side by side. Secondary reads as a quieter
   "alternative path" — muted text, no accent on hover. */
.notif-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.notif-action--secondary {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--line);
}

.notif-action--secondary:hover,
.notif-action--secondary:active {
  color: var(--text-soft);
  border-color: var(--line-strong);
}



/* ============================================================================
   Light theme — ticker stays dark for contrast, notifications adapt
   ========================================================================== */

/* PWA-037: light-mode override removed. The ticker now uses theme
   tokens directly so it inherits the correct surface colour, edge-
   fade colour, and severity hues automatically. */



/* Demo banner */
.demo-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: rgba(255, 184, 77, 0.12);
  border-bottom: 1px solid rgba(255, 184, 77, 0.3);
  color: var(--signal);
  font-family: var(--mono);
  font-size: 0.7rem;
  text-align: center;
  padding: 6px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  z-index: 200;
}
.demo-banner a {
  color: var(--signal);
  text-decoration: underline;
  pointer-events: auto;
}
#app { padding-top: calc(var(--sa-top) + 28px); }

