/* === CSS Custom Properties === */
:root {
  --bg-primary: #0a0a0a;
  --bg-panel: #111111;
  --bg-panel-alt: #0d0d0d;
  --bg-hover: #1a1a1a;
  --bg-active: #222222;
  --border: #1a1a1a;
  --border-bright: #2a2a2a;
  --accent: #00ff41;
  --accent-dim: #00cc33;
  --accent-glow: rgba(0, 255, 65, 0.15);
  --accent-glow-strong: rgba(0, 255, 65, 0.3);
  --text: #c0c0c0;
  --text-dim: #666666;
  --text-bright: #e0e0e0;
  --text-heading: #ffffff;
  --threat-critical: #ff3333;
  --threat-high: #ff8c00;
  --threat-medium: #ffd700;
  --threat-low: #00ff41;
  --event-color: #00d4aa;
  --rss-color: #4fc3f7;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  --header-height: 44px;
  --panel-width: 420px;
  --z-map: 1;
  --z-panel: 100;
  --z-header: 200;
  --z-overlay: 300;
  --z-feedback: 250;
  --intercept-bar-height: 34px;
}

/* === Theme: Amber === */
:root[data-theme="amber"] {
  --accent: #ffb300;
  --accent-dim: #e6a000;
  --accent-glow: rgba(255, 179, 0, 0.15);
  --accent-glow-strong: rgba(255, 179, 0, 0.3);
  --threat-low: #ffb300;
}

/* === Theme: Cyan === */
:root[data-theme="cyan"] {
  --accent: #00d4aa;
  --accent-dim: #00b893;
  --accent-glow: rgba(0, 212, 170, 0.15);
  --accent-glow-strong: rgba(0, 212, 170, 0.3);
  --threat-low: #00d4aa;
}

/* === Map Marker Animations === */
@keyframes marker-pulse {
  0%, 100% { fill-opacity: 0.5; stroke-opacity: 0.9; }
  50%       { fill-opacity: 0.9; stroke-opacity: 0.4; }
}
@keyframes marker-pulse-critical {
  0%, 100% { fill-opacity: 0.6; stroke-opacity: 1; }
  50%       { fill-opacity: 1;   stroke-opacity: 0.2; }
}
.marker-unread {
  animation: marker-pulse 2.5s ease-in-out infinite;
}
.marker-critical {
  animation: marker-pulse-critical 1.2s ease-in-out infinite;
}
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-primary);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: var(--bg-primary);
}

::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-panel);
}
::-webkit-scrollbar-thumb {
  background: var(--border-bright);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* === Header === */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  z-index: var(--z-header);
}

.header-left {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-center {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
}

.header-center .unread-badge.zero { opacity: 0.25; }

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

/* Auth widget */
.auth-widget {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  font-size: 11px;
}
.auth-login-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 0.5px;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.auth-login-link:hover { opacity: 1; }
.auth-user-info {
  display: flex;
  align-items: center;
  gap: 4px;
}
.auth-avatar {
  border-radius: 50%;
  border: 1px solid var(--border);
}
.auth-username {
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.5px;
}
.auth-logout-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13px;
  padding: 0 2px;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.auth-logout-btn:hover { opacity: 1; color: var(--accent); }
.demo-badge {
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--bg);
  background: var(--accent);
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 600;
}

.logo {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent-glow);
}

.threat-prefix {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  opacity: 0.8;
}

/* Threat badge */
.threat-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  border: 1px solid var(--border);
}
.threat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}
.threat-critical { border-color: var(--threat-critical); }
.threat-critical .threat-dot { background: var(--threat-critical); box-shadow: 0 0 6px var(--threat-critical); }
.threat-high { border-color: var(--threat-high); }
.threat-high .threat-dot { background: var(--threat-high); box-shadow: 0 0 6px var(--threat-high); }
.threat-medium { border-color: var(--threat-medium); }
.threat-medium .threat-dot { background: var(--threat-medium); }
.threat-low { border-color: var(--threat-low); }
.threat-low .threat-dot { background: var(--threat-low); }

#threat-label.glitch {
  position: relative;
  animation: threat-glitch-jitter 1.8s steps(1, end) infinite;
}
#threat-label.glitch::before,
#threat-label.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  pointer-events: none;
}
#threat-label.glitch::before {
  color: rgba(255, 0, 60, 0.75);
  transform: translate(-1px, 0);
  clip-path: inset(0 0 55% 0);
}
#threat-label.glitch::after {
  color: rgba(0, 220, 255, 0.75);
  transform: translate(1px, 0);
  clip-path: inset(45% 0 0 0);
}
@keyframes threat-glitch-jitter {
  0%, 88%, 100% { transform: translate(0, 0); }
  90% { transform: translate(-1px, 0); }
  92% { transform: translate(1px, -1px); }
  94% { transform: translate(-1px, 1px); }
  96% { transform: translate(1px, 0); }
}

.threat-sparkline {
  height: 18px;
  display: inline-flex;
  align-items: center;
  opacity: 0.9;
  flex-shrink: 0;
}
.threat-sparkline:empty {
  display: none;
}
.threat-sparkline svg {
  width: 100%;
  height: 100%;
  display: block;
}

.streak-badge {
  font-size: 11px;
  color: var(--text-dim);
}

/* Unread badge */
.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 5px;
  background: var(--accent);
  color: var(--bg-primary);
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
}
.unread-badge.zero { background: var(--border-bright); color: var(--text-dim); }

/* Header buttons */
.header-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 16px;
  transition: all 0.15s;
}
.header-btn:hover {
  border-color: var(--border-bright);
  color: var(--text);
  background: var(--bg-hover);
}
.header-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

/* === Map === */
#map {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-map);
  background: var(--bg-primary);
}
.leaflet-tile {
  will-change: transform;
}

/* Override Leaflet popup styles */
.leaflet-popup-content-wrapper {
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--border-bright);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}
.leaflet-popup-tip { background: var(--bg-panel); }
.leaflet-popup-content {
  margin: 10px 14px;
  line-height: 1.6;
}
.leaflet-popup-content a {
  color: var(--accent);
  text-decoration: none;
}
.leaflet-popup-content a:hover {
  text-decoration: underline;
}

/* Map attribution - keep it subtle */
.leaflet-control-attribution {
  background: rgba(10, 10, 10, 0.8) !important;
  color: var(--text-dim) !important;
  font-size: 10px !important;
}
.leaflet-control-attribution a {
  color: var(--text-dim) !important;
}

/* === Connection Status === */
.connection-status {
  position: fixed;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--threat-critical);
  color: white;
  padding: 4px 16px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  z-index: var(--z-overlay);
}
.connection-status.hidden { display: none; }
.connection-status.preview {
  background: var(--bg-panel);
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  cursor: pointer;
  transition: all 0.2s ease;
}
.connection-status.preview .connection-label::after {
  content: ' ⓘ';
  font-size: 10px;
}
.connection-status.preview.expanded {
  bottom: 0;
  left: 0;
  right: 0;
  transform: none;
  border-radius: 0;
  padding: 0;
  cursor: default;
  border-left: none;
  border-right: none;
  border-bottom: none;
  border-top: 1px solid var(--border-bright);
}
.preview-info {
  text-align: left;
  font-weight: 400;
  letter-spacing: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
  padding: 12px 16px 16px;
  max-width: 520px;
  margin: 0 auto;
}
.preview-info.hidden { display: none; }
.preview-info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-bright);
}
.preview-info-close {
  background: none;
  border: none;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-dim);
  padding: 0 2px;
}
.preview-info-close:hover { color: var(--text-bright); }
.preview-info p { margin: 4px 0; }
.preview-info strong { color: var(--text-bright); }
.preview-info ul {
  margin: 4px 0 8px 16px;
  padding: 0;
}
.preview-info ul li { margin: 2px 0; }
.preview-info code {
  background: var(--bg-hover);
  color: var(--accent);
  padding: 1px 5px;
  border-radius: 2px;
  font-size: 11px;
}

/* === Profiler hover card === */
.profiler-card {
  position: fixed;
  min-width: 220px;
  max-width: 300px;
  background: rgba(10, 10, 10, 0.95);
  border: 1px solid var(--accent);
  border-radius: 3px;
  padding: 8px 10px;
  z-index: calc(var(--z-overlay) + 5);
  pointer-events: none;
  box-shadow: 0 0 20px var(--accent-glow-strong);
  overflow: hidden;
}
.profiler-scanline {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.55;
  will-change: transform;
  animation: profiler-scan 1.2s linear infinite;
}
@keyframes profiler-scan {
  0% { transform: translateY(0); }
  100% { transform: translateY(calc(var(--profiler-h, 80px) - 2px)); }
}
.profiler-label {
  font-size: 9px;
  color: var(--accent-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.profiler-title {
  color: var(--text-bright);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 3px;
}
.profiler-meta {
  color: var(--accent);
  font-size: 10px;
  margin-bottom: 4px;
}
.profiler-summary {
  color: var(--text);
  font-size: 11px;
  line-height: 1.4;
}

/* === Briefing skeleton === */
.briefing-skeleton {
  padding: 12px;
}
.skeleton-line {
  height: 12px;
  border-radius: 3px;
  margin: 8px 0;
  background: linear-gradient(
    90deg,
    var(--bg-panel-alt) 0%,
    var(--bg-hover) 45%,
    var(--bg-panel-alt) 100%
  );
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.25s ease infinite;
}
.skeleton-line.lg { height: 18px; width: 70%; }
.skeleton-line.md { width: 92%; }
.skeleton-line.sm { width: 62%; }
@keyframes skeleton-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* === Connection line overlay (map → panel) === */
.connection-line-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1500;
}
.connection-line-path {
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: square;
  stroke-linejoin: miter;
  filter: drop-shadow(0 0 3px var(--accent-glow, rgba(0,255,65,0.4)));
}
.connection-line-path.animate-in {
  animation: draw-connection 0.4s linear forwards;
}
.connection-line-node {
  opacity: 0.9;
  filter: drop-shadow(0 0 4px var(--accent-glow, rgba(0,255,65,0.4)));
}
.fade-out {
  animation: fade-connection 0.8s ease forwards !important;
}
@keyframes draw-connection {
  from { stroke-dashoffset: var(--path-len); }
  to { stroke-dashoffset: 0; }
}
@keyframes fade-connection {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* === Audio visualizer (header) === */
.audio-visualizer {
  width: 48px;
  height: 20px;
  margin-left: 6px;
  flex-shrink: 0;
  opacity: 0.85;
  vertical-align: middle;
}

/* === Inline music bar (header) === */
.music-bar-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 6px;
  padding: 2px 6px;
  border: 1px solid var(--border-bright);
  border-radius: 3px;
  background: rgba(12, 12, 12, 0.6);
  height: 26px;
  flex-shrink: 0;
}
.music-btn-sm {
  width: 18px;
  height: 18px;
  border: 1px solid var(--border-bright);
  border-radius: 2px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 9px;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.music-btn-sm:hover { border-color: var(--accent); color: var(--accent); }
.music-select-sm {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--border-bright);
  border-radius: 2px;
  padding: 1px 2px;
  height: 20px;
  max-width: 130px;
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  /* Custom dropdown arrow */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%23666'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 3px center;
  padding-right: 12px;
}
.music-select-sm:hover,
.music-select-sm:focus { border-color: var(--accent); }
.music-select-sm option {
  background: var(--bg-panel);
  color: var(--text-bright);
  font-family: var(--font-mono);
  font-size: 11px;
}
.music-now-sm {
  font-size: 9px;
  color: var(--text-dim);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.music-volume-sm {
  accent-color: var(--accent);
  height: 3px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border-bright);
  border-radius: 2px;
  outline: none;
}
.music-volume-sm::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}
.music-volume-sm { width: 40px; }

/* === Feedback Box === */
.feedback-toggle {
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-bright);
  border-radius: 50%;
  background: var(--bg-panel);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  z-index: var(--z-feedback);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.feedback-toggle:hover {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.feedback-box {
  position: fixed;
  bottom: 70px;
  right: 16px;
  width: 340px;
  background: var(--bg-panel);
  border: 1px solid var(--border-bright);
  border-radius: 4px;
  z-index: var(--z-feedback);
  padding: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.feedback-box.hidden { display: none; }
.feedback-box textarea {
  width: 100%;
  height: 100px;
  background: var(--bg-primary);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  resize: vertical;
}
.feedback-box textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.feedback-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  justify-content: flex-end;
}
.feedback-actions button {
  padding: 4px 14px;
  border: 1px solid var(--border-bright);
  background: var(--bg-hover);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  border-radius: 3px;
}
.feedback-actions button:first-child {
  border-color: var(--accent);
  color: var(--accent);
}
.feedback-actions button:hover {
  background: var(--bg-active);
}

/* === Toast notifications === */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + 12px);
  right: 16px;
  z-index: 250;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 8px 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border-bright);
  border-left: 3px solid var(--accent);
  color: var(--text-bright);
  font-size: 12px;
  border-radius: 3px;
  opacity: 0;
  transform: translateX(100%);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: auto;
}
.toast.visible { opacity: 1; transform: translateX(0); }
.toast-briefing { border-left-color: var(--accent); }
.toast-feeds { border-left-color: var(--rss-color); }
.toast-events { border-left-color: var(--event-color); }
.toast-info { border-left-color: var(--text-dim); }
.toast-xp { border-left-color: var(--text-dim); opacity: 0.85; }
.toast-levelup { border-left-color: var(--accent); box-shadow: 0 0 8px var(--accent); font-weight: 600; }

/* === Level / XP widget === */
.level-widget {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-family: var(--font-mono);
  cursor: default;
  user-select: none;
  position: relative;
}
.level-badge {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.03em;
}
.level-bar-wrap {
  width: 64px;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border-bright);
  border-radius: 3px;
  overflow: hidden;
}
.level-bar-fill {
  display: block;
  height: 100%;
  min-width: 3px;
  background: var(--accent);
  border-radius: 3px;
  box-shadow: 0 0 6px var(--accent);
  transition: width 0.4s ease;
}
.level-xp-label {
  color: var(--text-dim);
  font-size: 10px;
}
.level-title {
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.02em;
  opacity: 0.85;
}
.level-desc {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border-bright);
  border-left: 2px solid var(--accent);
  padding: 6px 10px;
  font-size: 11px;
  font-style: italic;
  color: var(--text-dim);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 100;
}
.level-widget:hover .level-desc {
  opacity: 1;
  transform: translateY(0);
}

/* === Keyboard shortcut hints === */
.shortcuts-content {
  width: 400px;
  background: var(--bg-panel);
  border: 1px solid var(--border-bright);
  border-radius: 4px;
  padding: 20px;
}
.shortcuts-content h3 {
  color: var(--accent);
  font-size: 14px;
  margin-bottom: 12px;
}
.shortcut-grid {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 8px 16px;
  margin: 16px 0;
}
.shortcut-key kbd {
  display: inline-block;
  padding: 2px 8px;
  background: var(--bg-hover);
  border: 1px solid var(--border-bright);
  border-radius: 3px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--accent);
}
.shortcut-action {
  font-size: 12px;
  color: var(--text);
  line-height: 24px;
}
.shortcuts-dismiss {
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
}
.shortcuts-dismiss kbd {
  display: inline-block;
  padding: 0 4px;
  background: var(--bg-hover);
  border: 1px solid var(--border-bright);
  border-radius: 2px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text);
}

/* Header badge for events unread count */
.header-badge {
  display: inline-block;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  background: var(--event-color);
  color: var(--bg-primary);
  font-size: 9px;
  font-weight: 700;
  border-radius: 7px;
  text-align: center;
  line-height: 14px;
  position: relative;
  top: -6px;
  margin-left: -4px;
}
.header-badge.zero {
  background: var(--border-bright);
  color: var(--text-dim);
}

/* === Empty states === */
.empty-state {
  color: var(--text-dim);
  text-align: center;
  padding: 40px 20px;
  font-size: 12px;
}

/* === Utility === */
.hidden { display: none !important; }

/* Markdown rendered content */
.markdown-body {
  color: var(--text);
  font-size: 12px;
  line-height: 1.7;
}
.markdown-body h1 { color: var(--accent); font-size: 18px; margin: 16px 0 8px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.markdown-body h2 { color: var(--text-heading); font-size: 15px; margin: 14px 0 6px; }
.markdown-body h3 { color: var(--text-bright); font-size: 13px; margin: 12px 0 4px; }
.markdown-body p { margin: 6px 0; }
.markdown-body a { color: var(--accent); text-decoration: none; }
.markdown-body a:hover { text-decoration: underline; }
.markdown-body code { background: var(--bg-hover); padding: 1px 5px; border-radius: 2px; font-size: 12px; }
.markdown-body pre { background: var(--bg-primary); border: 1px solid var(--border); border-radius: 3px; padding: 10px; overflow-x: auto; margin: 8px 0; }
.markdown-body pre code { background: none; padding: 0; }
.markdown-body blockquote { border-left: 3px solid var(--accent); padding-left: 12px; color: var(--text-dim); margin: 8px 0; }
.markdown-body ul, .markdown-body ol { padding-left: 20px; margin: 6px 0; }
.markdown-body li { margin: 2px 0; }
.markdown-body table { border-collapse: collapse; width: 100%; margin: 8px 0; }
.markdown-body th, .markdown-body td { border: 1px solid var(--border); padding: 4px 8px; text-align: left; font-size: 11px; }
.markdown-body th { background: var(--bg-hover); color: var(--text-bright); }
.markdown-body hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.markdown-body img { max-width: 100%; border-radius: 3px; }

/* Checkbox styling for action items */
.markdown-body input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border: 1px solid var(--text-dim);
  border-radius: 2px;
  background: var(--bg-primary);
  cursor: pointer;
  vertical-align: middle;
  margin-right: 6px;
  position: relative;
}
.markdown-body input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.markdown-body input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: -2px;
  left: 1px;
  font-size: 12px;
  color: var(--bg-primary);
  font-weight: bold;
}

/* === Command Palette === */
.palette-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: calc(var(--z-overlay) + 10);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}
.palette-overlay.hidden { display: none; }
.palette-box {
  width: 560px;
  max-width: 90vw;
  max-height: 60vh;
  background: var(--bg-panel);
  border: 1px solid var(--border-bright);
  border-radius: 5px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.palette-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.palette-icon {
  color: var(--text-dim);
  font-size: 14px;
  flex-shrink: 0;
}
#palette-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-bright);
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
}
.palette-esc-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  border: 1px solid var(--border-bright);
  border-radius: 3px;
  padding: 1px 6px;
}
.palette-results {
  overflow-y: auto;
  flex: 1;
  padding: 4px 0;
}
.palette-empty {
  padding: 20px 14px;
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
}
.palette-group-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-dim);
  padding: 8px 14px 3px;
  text-transform: uppercase;
}
.palette-result {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 14px;
  cursor: pointer;
}
.palette-result:hover,
.palette-result.palette-active {
  background: var(--bg-hover);
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}
.palette-result-icon {
  font-size: 12px;
  flex-shrink: 0;
  width: 16px;
}
.palette-result-title {
  flex: 1;
  font-size: 12px;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.palette-result-meta {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}
/* Command mode styling */
.palette-cmd-hint {
  padding: 6px 14px;
  font-size: 11px;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.palette-cmd-hint code {
  background: var(--bg-active);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--text-bright);
  font-family: var(--font-mono);
}
.palette-result[data-type="command"] .palette-result-icon { color: var(--accent); }
.palette-cmd-output {
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-bright);
  white-space: pre-wrap;
  font-family: var(--font-mono);
  line-height: 1.7;
}

/* ═══════════════════════════════════════════════════════════════════════
   Phase 4 — Visual Effects: Glitch, CRT, Animations
   ═══════════════════════════════════════════════════════════════════════ */

/* ── CRT Scanline Overlay ─────────────────────────────────────────────
   Subtle TV scanlines across the entire viewport. Togglable.          */
.crt-on::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.06) 0px,
    rgba(0, 0, 0, 0.06) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
}

/* ── Glitch Text — hover effect for headings ──────────────────────── */
@keyframes glitch-skew {
  0%    { transform: skewX(0deg); }
  20%   { transform: skewX(-2deg); }
  40%   { transform: skewX(1deg); }
  60%   { transform: skewX(-1deg); }
  80%   { transform: skewX(2deg); }
  100%  { transform: skewX(0deg); }
}
@keyframes glitch-clip-1 {
  0%    { clip-path: inset(20% 0 60% 0); }
  20%   { clip-path: inset(80% 0 0% 0); }
  40%   { clip-path: inset(0% 0 85% 0); }
  60%   { clip-path: inset(50% 0 30% 0); }
  80%   { clip-path: inset(10% 0 70% 0); }
  100%  { clip-path: inset(40% 0 40% 0); }
}
@keyframes glitch-clip-2 {
  0%    { clip-path: inset(60% 0 10% 0); }
  20%   { clip-path: inset(10% 0 70% 0); }
  40%   { clip-path: inset(70% 0 5% 0); }
  60%   { clip-path: inset(5% 0 80% 0); }
  80%   { clip-path: inset(40% 0 30% 0); }
  100%  { clip-path: inset(25% 0 50% 0); }
}

.glitch-hover {
  position: relative;
}
.glitch-hover:hover {
  animation: glitch-skew 0.4s steps(4) both;
}
.glitch-hover::before,
.glitch-hover::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
}
.glitch-hover:hover::before {
  opacity: 1;
  color: rgba(255, 0, 60, 0.7);
  animation: glitch-clip-1 0.3s steps(3) infinite alternate-reverse;
  transform: translate(-2px, 0);
}
.glitch-hover:hover::after {
  opacity: 1;
  color: rgba(0, 220, 255, 0.7);
  animation: glitch-clip-2 0.3s steps(3) infinite alternate;
  transform: translate(2px, 0);
}

/* Triggered glitch (one-shot via JS adding .glitch-trigger class) */
@keyframes glitch-burst {
  0%   { transform: translate(0); filter: none; }
  10%  { transform: translate(-2px, 1px); filter: hue-rotate(90deg); }
  20%  { transform: translate(2px, -1px); filter: hue-rotate(-90deg); }
  30%  { transform: translate(-1px, -1px); }
  40%  { transform: translate(1px, 1px); filter: hue-rotate(45deg); }
  50%  { transform: translate(0, -2px); filter: none; }
  60%  { transform: translate(-1px, 0); filter: hue-rotate(-45deg); }
  70%  { transform: translate(2px, 1px); }
  80%  { transform: translate(-2px, -1px); filter: hue-rotate(90deg); }
  90%  { transform: translate(1px, 0); filter: none; }
  100% { transform: translate(0); filter: none; }
}
.glitch-trigger {
  animation: glitch-burst 0.35s steps(2) !important;
}

/* Logo glitch effect */
.logo {
  position: relative;
}
.logo.glitch-hover::before,
.logo.glitch-hover::after {
  content: 'CYBERSPACE';
}

/* ── Panel Border Glitch on Open ──────────────────────────────────── */
@keyframes border-glitch {
  0%   { border-color: var(--accent); box-shadow: 0 0 8px var(--accent-glow-strong), inset 0 0 8px var(--accent-glow); }
  15%  { border-color: var(--threat-critical); box-shadow: 0 0 6px rgba(255,51,51,0.3); }
  30%  { border-color: var(--accent); box-shadow: none; }
  45%  { border-color: #00d4ff; box-shadow: 0 0 10px rgba(0,212,255,0.3); }
  60%  { border-color: var(--border); box-shadow: none; }
  75%  { border-color: var(--accent); box-shadow: 0 0 4px var(--accent-glow); }
  90%  { border-color: var(--border-bright); box-shadow: none; }
  100% { border-color: var(--border); box-shadow: none; }
}
.panel-glitch-border {
  animation: border-glitch 0.5s steps(3) both;
}

/* ── Marker Drop-in Animation ─────────────────────────────────────── */
@keyframes marker-drop {
  0%   { transform: scale(0) translateY(-20px); opacity: 0; }
  50%  { transform: scale(1.3) translateY(2px); opacity: 0.8; }
  70%  { transform: scale(0.9) translateY(0); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
.marker-dropin {
  animation: marker-drop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Staggered delay classes for markers loading in sequence */
.marker-delay-1 { animation-delay: 0.03s; }
.marker-delay-2 { animation-delay: 0.06s; }
.marker-delay-3 { animation-delay: 0.09s; }
.marker-delay-4 { animation-delay: 0.12s; }
.marker-delay-5 { animation-delay: 0.15s; }
.marker-delay-6 { animation-delay: 0.18s; }
.marker-delay-7 { animation-delay: 0.21s; }
.marker-delay-8 { animation-delay: 0.24s; }
.marker-delay-9 { animation-delay: 0.27s; }

/* ── Enhanced Profiler Card — Watch Dogs style ────────────────────── */
.profiler-card {
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}
.profiler-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid var(--accent);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  pointer-events: none;
  opacity: 0.7;
}
/* Scan progress bar at top of profiler */
.profiler-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow-strong);
  width: 0;
  animation: profiler-fill 0.8s ease-out forwards;
  z-index: 2;
}
@keyframes profiler-fill {
  0%   { width: 0; }
  100% { width: 100%; }
}
/* Corner brackets (Watch Dogs style) */
.profiler-corner {
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: var(--accent);
  border-style: solid;
  pointer-events: none;
  opacity: 0.5;
}
.profiler-corner-tl { top: 3px; left: 3px; border-width: 1px 0 0 1px; }
.profiler-corner-tr { top: 3px; right: 3px; border-width: 1px 1px 0 0; }
.profiler-corner-bl { bottom: 3px; left: 3px; border-width: 0 0 1px 1px; }
.profiler-corner-br { bottom: 3px; right: 3px; border-width: 0 1px 1px 0; }

/* Profiler data-load typewriter cursor */
.profiler-title::after {
  content: '█';
  animation: blink-cursor 0.5s step-end infinite;
  color: var(--accent);
  font-weight: 300;
  margin-left: 1px;
}
@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

/* ── Feed Item Staggered Load ─────────────────────────────────────── */
@keyframes feed-slide-in {
  0%   { opacity: 0; transform: translateX(-8px); }
  100% { transform: translateX(0); }
}
.feed-anim-in {
  animation: feed-slide-in 0.25s ease-out;
}

/* ── Event Item Staggered Load ────────────────────────────────────── */
@keyframes event-slide-in {
  0%   { opacity: 0; transform: translateY(6px); }
  100% { transform: translateY(0); }
}
.event-anim-in {
  animation: event-slide-in 0.2s ease-out;
}

/* ── Typewriter for briefing heading ──────────────────────────────── */
.typewriter-heading {
  overflow: hidden;
  border-right: 2px solid var(--accent);
  white-space: nowrap;
  animation: tw-type 1.5s steps(40) forwards, tw-cursor 0.5s step-end 6;
  width: 0;
}
@keyframes tw-type {
  0%   { width: 0; }
  100% { width: 100%; }
}
@keyframes tw-cursor {
  0%, 100% { border-color: var(--accent); }
  50%      { border-color: transparent; }
}

/* ── Data-received flash on panels ────────────────────────────────── */
@keyframes data-flash {
  0%   { box-shadow: inset 0 0 20px var(--accent-glow-strong); }
  100% { box-shadow: none; }
}
.data-flash {
  animation: data-flash 0.6s ease-out;
}

/* ── Notification pulse on header buttons ─────────────────────────── */
@keyframes btn-notify-pulse {
  0%, 100% { box-shadow: none; }
  50%      { box-shadow: 0 0 8px var(--accent-glow-strong); }
}
.btn-notify-pulse {
  animation: btn-notify-pulse 1s ease-in-out 3;
}

/* ── Ambient glow on map container ────────────────────────────────── */
#map::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(
    ellipse at 50% 0%,
    var(--accent-glow) 0%,
    transparent 60%
  );
  opacity: 0.15;
}

/* ── Vignette overlay (dark edges) ────────────────────────────────── */
.vignette::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: radial-gradient(
    ellipse at 50% 50%,
    transparent 55%,
    rgba(0, 0, 0, 0.5) 100%
  );
}

/* === Announcement Overlay (Intercepted Transmission) === */
.announcement-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ann-fadein 0.3s ease;
}
.announcement-overlay.hidden { display: none; }
.announcement-overlay.announcement-closing {
  animation: ann-fadeout 0.4s ease forwards;
}

@keyframes ann-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes ann-fadeout {
  from { opacity: 1; }
  to   { opacity: 0; }
}

.announcement-box {
  width: 680px;
  max-width: 92vw;
  max-height: 82vh;
  background: #09080d;
  border: 1px solid #4a253a;
  box-shadow:
    0 0 0 1px #1a0f1f,
    0 0 30px rgba(100, 30, 80, 0.18),
    0 0 60px rgba(100, 30, 80, 0.07),
    inset 0 0 60px rgba(100, 30, 80, 0.03);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  animation: ann-slidein 0.35s cubic-bezier(0.15, 0, 0.1, 1);
}

@keyframes ann-slidein {
  from { transform: translateY(-14px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* scanlines overlay */
.announcement-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(130, 60, 100, 0.012) 3px,
    rgba(130, 60, 100, 0.012) 4px
  );
  pointer-events: none;
  z-index: 0;
}

.announcement-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px 16px 10px;
  border-bottom: 1px solid #2a1a2a;
  background: #0c0a11;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.announcement-header-left {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 0;
}

.announcement-title {
  font-size: 17px;
  font-weight: 600;
  color: #c07055;
  letter-spacing: 0.5px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.announcement-classification {
  font-size: 10px;
  font-weight: 600;
  color: #905060;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  animation: ann-warn-pulse 5s ease infinite;
  display: flex;
  align-items: center;
  gap: 10px;
}

.announcement-warn-icon {
  animation: ann-warn-icon 4s ease infinite;
}
@keyframes ann-warn-icon {
  0%, 100% { opacity: 0.9; }
  50%       { opacity: 0.3; }
}
@keyframes ann-warn-pulse {
  0%, 100% { opacity: 0.85; }
  50%       { opacity: 0.5; }
}

.announcement-close {
  background: none;
  border: 1px solid #2e1c2e;
  color: #805060;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  flex-shrink: 0;
  margin-top: 2px;
}
.announcement-close:hover {
  background: #1e1020;
  border-color: #a06070;
  color: #c08090;
}

.announcement-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding: 6px 16px;
  border-bottom: 1px solid #140e1a;
  font-size: 10px;
  color: #3d2a3a;
  letter-spacing: 2px;
  background: #07060c;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.announcement-meta-date,
.announcement-author {
  color: #6a4555;
}

.announcement-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 16px;
  border-bottom: 1px solid #140e1a;
  background: #07060c;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.announcement-nav.hidden { display: none; }
.announcement-nav-counter {
  font-size: 10px;
  letter-spacing: 2px;
  color: #4a2e50;
  font-family: var(--font-mono);
}
.announcement-nav-prev,
.announcement-nav-next {
  background: none;
  border: 1px solid #2a1830;
  color: #6a4555;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  padding: 3px 10px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.announcement-nav-prev:hover:not(:disabled),
.announcement-nav-next:hover:not(:disabled) {
  color: #c080a0;
  border-color: #5a2a50;
}
.announcement-nav-prev:disabled,
.announcement-nav-next:disabled {
  opacity: 0.25;
  cursor: default;
}


  flex: 1;
  overflow-y: auto;
  padding: 22px 24px;
  position: relative;
  z-index: 1;
}
.announcement-body::-webkit-scrollbar { width: 8px; }
.announcement-body::-webkit-scrollbar-track { background: #0e0b15; border-left: 1px solid #1a1020; }
.announcement-body::-webkit-scrollbar-thumb { background: #5a2545; border-radius: 3px; border: 1px solid #3a1530; }
.announcement-body::-webkit-scrollbar-thumb:hover { background: #7a3560; }

.announcement-text {
  font-size: 13px;
  line-height: 1.9;
  color: #ad97a8;
  font-family: var(--font-mono);
  word-break: break-word;
}

.announcement-cursor {
  display: inline-block;
  width: 7px;
  height: 1.1em;
  background: #905060;
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: ann-cursor 0.9s ease infinite;
}
@keyframes ann-cursor {
  0%, 100% { opacity: 0.9; }
  50%       { opacity: 0; }
}

.announcement-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  border-top: 1px solid #140e1a;
  background: #07060c;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.announcement-watermark {
  font-size: 9px;
  color: #231828;
  letter-spacing: 2px;
}

.announcement-footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.announcement-skip-btn {
  background: none;
  border: 1px solid #1e1425;
  color: #60404e;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.announcement-skip-btn:hover {
  background: #100b14;
  border-color: #60404e;
  color: #8a6070;
}
.announcement-skip-btn.skip-hidden {
  opacity: 0;
  pointer-events: none;
}

.announcement-dismiss-btn {
  background: none;
  border: 1px solid #3a2040;
  color: #905060;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.announcement-dismiss-btn:hover {
  background: #180f20;
  border-color: #905060;
  color: #c07080;
}

/* === Announcement scroll hint (fade + bounce arrow) === */
.announcement-scroll-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 42px; /* sits just above the footer */
  height: 72px;
  background: linear-gradient(to bottom, transparent, rgba(9, 8, 13, 0.97));
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8px;
  pointer-events: none;
  z-index: 3;
  opacity: 1;
  transition: opacity 0.35s ease;
}
.announcement-scroll-hint.hidden { opacity: 0; }
.announcement-scroll-hint::after {
  content: '▼  scroll';
  color: #00cc66;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 3px;
  text-transform: uppercase;
  animation: scroll-hint-bounce 1.6s ease infinite;
}
@keyframes scroll-hint-bounce {
  0%, 100% { transform: translateY(0);   opacity: 0.65; }
  50%       { transform: translateY(6px); opacity: 1; }
}

/* === Intercept Alert Bar === */
.intercept-bar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  height: var(--intercept-bar-height);
  background: #0c0911;
  border-bottom: 1px solid #2e1a2e;
  box-shadow: 0 2px 12px rgba(80, 20, 70, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 0 12px;
  z-index: 150;
  animation: intercept-slide-in 0.4s cubic-bezier(0.2, 0, 0.1, 1);
}
.intercept-bar.hidden { display: none; }
.intercept-bar.intercept-bar-closing {
  animation: intercept-slide-out 0.3s ease forwards;
}

@keyframes intercept-slide-in {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
@keyframes intercept-slide-out {
  from { transform: translateY(0);     opacity: 1; }
  to   { transform: translateY(-100%); opacity: 0; }
}

.intercept-bar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  cursor: pointer;
}

.intercept-bar-pulse {
  color: #905060;
  animation: ann-warn-icon 3.5s ease infinite;
  flex-shrink: 0;
  font-size: 11px;
}

.intercept-bar-label {
  font-size: 10px;
  font-weight: 600;
  color: #905060;
  letter-spacing: 2.5px;
  flex-shrink: 0;
  animation: ann-warn-pulse 4.5s ease infinite;
}

.intercept-sep {
  color: #2a1530;
  flex-shrink: 0;
}

.intercept-bar-title {
  font-size: 12px;
  font-weight: 500;
  color: #c07055;
  letter-spacing: 0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.intercept-bar-by {
  font-size: 10px;
  color: #2a1530;
  flex-shrink: 0;
}

.intercept-bar-author {
  font-size: 10px;
  color: #6a4555;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.intercept-bar-cta {
  font-size: 10px;
  color: #40283a;
  letter-spacing: 1px;
  flex-shrink: 0;
  margin-left: 6px;
}
.intercept-bar-inner:hover .intercept-bar-title { color: #d08065; }
.intercept-bar-inner:hover .intercept-bar-cta   { color: #8a5060; }

.intercept-bar-dismiss-btn {
  background: none;
  border: none;
  color: #2e1c2e;
  font-family: var(--font-mono);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  flex-shrink: 0;
  transition: color 0.15s;
  line-height: 1;
}
.intercept-bar-dismiss-btn:hover {
  color: #905060;
}

/* === Intercept Header Icon === */
.intercept-btn {
  background: rgba(120, 30, 55, 0.12);
  border: 1px solid #7a3550;
  color: #d06878;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  padding: 4px 10px;
  cursor: pointer;
  font-family: var(--font-mono);
  line-height: 1;
  transition: all 0.2s;
  box-shadow: 0 0 10px rgba(180, 50, 80, 0.25), inset 0 0 6px rgba(180, 50, 80, 0.06);
  animation: intercept-pulse 2.5s ease infinite;
  white-space: nowrap;
}
@keyframes intercept-pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(180, 50, 80, 0.25), inset 0 0 6px rgba(180, 50, 80, 0.06); border-color: #7a3550; }
  50%       { box-shadow: 0 0 16px rgba(200, 60, 90, 0.45), inset 0 0 8px rgba(200, 60, 90, 0.1);  border-color: #b05070; }
}
.intercept-btn:hover {
  border-color: #d06878;
  color: #f08898;
  background: rgba(150, 40, 70, 0.2);
  box-shadow: 0 0 18px rgba(200, 70, 90, 0.5);
  animation: none;
}
.intercept-btn.hidden { display: none; }

/* === Matrix-Themed Intercept Button Override === */
.intercept-btn {
  border-color: #004400;
  color: #00cc33;
  background: rgba(0, 60, 0, 0.15);
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.15), inset 0 0 6px rgba(0, 255, 65, 0.04);
  animation: intercept-pulse-matrix 3s ease infinite;
}
@keyframes intercept-pulse-matrix {
  0%, 100% { box-shadow: 0 0 10px rgba(0, 255, 65, 0.15), inset 0 0 6px rgba(0, 255, 65, 0.04); border-color: #004400; }
  50%       { box-shadow: 0 0 18px rgba(0, 255, 65, 0.3), inset 0 0 8px rgba(0, 255, 65, 0.08);  border-color: #006600; }
}
.intercept-btn:hover {
  border-color: #00cc33;
  color: #00ff41;
  background: rgba(0, 60, 0, 0.25);
  box-shadow: 0 0 22px rgba(0, 255, 65, 0.4);
  animation: none;
}

/* === Matrix-Themed Announcement Overlay === */
.announcement-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 8, 0, 0.88);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ann-fadein 0.3s ease;
}
.announcement-overlay.hidden { display: none; }
.announcement-overlay.announcement-closing {
  animation: ann-fadeout 0.4s ease forwards;
}

@keyframes ann-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes ann-fadeout {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes matrix-rain {
  0% { background-position: 0 0; }
  100% { background-position: 0 100%; }
}

.announcement-box {
  width: 680px;
  max-width: 92vw;
  max-height: 82vh;
  background: #000800;
  border: 1px solid #004400;
  box-shadow:
    0 0 0 1px #003300,
    0 0 40px rgba(0, 255, 65, 0.12),
    0 0 80px rgba(0, 255, 65, 0.05),
    inset 0 0 60px rgba(0, 255, 65, 0.02);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  animation: ann-slidein 0.35s cubic-bezier(0.15, 0, 0.1, 1);
}

@keyframes ann-slidein {
  from { transform: translateY(-18px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* scanlines overlay with digital rain hint */
.announcement-scanlines {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(0, 255, 65, 0.015) 3px,
      rgba(0, 255, 65, 0.015) 4px
    ),
    repeating-linear-gradient(
      180deg,
      transparent 0%,
      rgba(0, 255, 65, 0.008) 25%,
      transparent 50%,
      rgba(0, 180, 45, 0.005) 75%,
      transparent 100%
    );
  background-size: 100% 4px, 20px 400px;
  animation: matrix-rain 12s linear infinite;
  pointer-events: none;
  z-index: 0;
}

.announcement-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px 16px 10px;
  border-bottom: 1px solid #0a3a0a;
  background: #000a00;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.announcement-header-left {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 0;
}

.announcement-title {
  font-size: 17px;
  font-weight: 700;
  color: #00ff41;
  letter-spacing: 1px;
  line-height: 1.2;
  text-shadow: 0 0 20px rgba(0, 255, 65, 0.35), 0 0 40px rgba(0, 255, 65, 0.12);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.announcement-classification {
  font-size: 11px;
  font-weight: 700;
  color: #00cc33;
  letter-spacing: 3px;
  text-transform: uppercase;
  animation: ann-warn-pulse 3s ease infinite;
  display: flex;
  align-items: center;
  gap: 10px;
}

.announcement-warn-icon {
  animation: ann-warn-icon 2.5s ease infinite;
}
@keyframes ann-warn-icon {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}
@keyframes ann-warn-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.announcement-close {
  background: none;
  border: 1px solid #003300;
  color: #00aa33;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  flex-shrink: 0;
  margin-top: 2px;
}
.announcement-close:hover {
  background: #0a3a0a;
  border-color: #00ff41;
  color: #00ff41;
}

.announcement-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding: 6px 16px;
  border-bottom: 1px solid #001a00;
  font-size: 10px;
  color: #1a4a1a;
  letter-spacing: 2px;
  background: #000600;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.announcement-meta-date,
.announcement-author {
  color: #448844;
}

.announcement-nav {
  border-bottom-color: #001a00;
  background: #000600;
}
.announcement-nav-counter { color: #1a4a1a; }
.announcement-nav-prev,
.announcement-nav-next {
  border-color: #003300;
  color: #448844;
}
.announcement-nav-prev:hover:not(:disabled),
.announcement-nav-next:hover:not(:disabled) {
  color: #00cc33;
  border-color: #006600;
}

.announcement-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 24px;
  position: relative;
  z-index: 1;
}
.announcement-body::-webkit-scrollbar { width: 4px; }
.announcement-body::-webkit-scrollbar-track { background: #000500; }
.announcement-body::-webkit-scrollbar-thumb { background: #003300; border-radius: 2px; }
.announcement-body::-webkit-scrollbar-thumb:hover { background: #006600; }

.announcement-text {
  font-size: 13px;
  line-height: 1.9;
  color: #88cc88;
  font-family: var(--font-mono);
  word-break: break-word;
}

/* Markdown elements inside announcement */
.announcement-text a {
  color: #00ff41;
  text-decoration: underline;
  text-decoration-color: rgba(0, 255, 65, 0.3);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.15s;
}
.announcement-text a:hover {
  text-decoration-color: #00ff41;
}
.announcement-text h1,
.announcement-text h2,
.announcement-text h3 {
  color: #00ff41;
  margin: 1.2em 0 0.4em;
  font-size: 1.1em;
  letter-spacing: 1px;
}
.announcement-text h1 { font-size: 1.3em; }
.announcement-text strong {
  color: #aaffaa;
  font-weight: 700;
}
.announcement-text em {
  color: #88cc88;
  font-style: italic;
}
.announcement-text hr {
  border: none;
  border-top: 1px solid #003300;
  margin: 1.2em 0;
}
.announcement-text ul,
.announcement-text ol {
  padding-left: 1.5em;
  margin: 0.6em 0;
}
.announcement-text li {
  margin: 0.3em 0;
}
.announcement-text li::marker {
  color: #006600;
}
.announcement-text pre {
  background: #000a00;
  border: 1px solid #003300;
  border-radius: 3px;
  padding: 10px 12px;
  overflow-x: auto;
  margin: 0.8em 0;
  font-size: 0.92em;
}
.announcement-text code {
  color: #66ff66;
  font-family: var(--font-mono);
}
.announcement-text p {
  margin: 0.6em 0;
}

.announcement-cursor {
  display: inline-block;
  width: 7px;
  height: 1.1em;
  background: #00ff41;
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: ann-cursor 0.75s ease infinite;
}
@keyframes ann-cursor {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.announcement-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  border-top: 1px solid #001a00;
  background: #000600;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.announcement-watermark {
  font-size: 9px;
  color: #0a2d0a;
  letter-spacing: 2px;
}

.announcement-footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.announcement-skip-btn {
  background: none;
  border: 1px solid #0a3a0a;
  color: #448844;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.announcement-skip-btn:hover {
  background: #001100;
  border-color: #448844;
  color: #66aa66;
}
.announcement-skip-btn.skip-hidden {
  opacity: 0;
  pointer-events: none;
}

.announcement-dismiss-btn {
  background: none;
  border: 1px solid #003300;
  color: #00cc33;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.announcement-dismiss-btn:hover {
  background: #001a00;
  border-color: #00cc33;
  color: #00ff41;
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.15);
}

/* === Intercept Alert Bar (Encrypted Signal) === */
.intercept-bar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  height: var(--intercept-bar-height);
  background: linear-gradient(
    90deg,
    #000800 0%,
    #000a00 40%,
    #000a00 60%,
    #000800 100%
  );
  border-bottom: 1px solid #004400;
  box-shadow: 0 3px 18px rgba(0, 255, 65, 0.08), inset 0 1px 0 #001a00;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 0 12px;
  z-index: 150;
  animation: intercept-slide-in 0.4s cubic-bezier(0.2, 0, 0.1, 1);
}
.intercept-bar.hidden { display: none; }
.intercept-bar.intercept-bar-closing {
  animation: intercept-slide-out 0.3s ease forwards;
}

@keyframes intercept-slide-in {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
@keyframes intercept-slide-out {
  from { transform: translateY(0);     opacity: 1; }
  to   { transform: translateY(-100%); opacity: 0; }
}

.intercept-bar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  cursor: pointer;
}

.intercept-bar-pulse {
  color: #00cc33;
  animation: ann-warn-icon 2.5s ease infinite;
  flex-shrink: 0;
  font-size: 12px;
}

.intercept-bar-label {
  font-size: 10px;
  font-weight: 700;
  color: #00cc33;
  letter-spacing: 3px;
  flex-shrink: 0;
  animation: ann-warn-pulse 3s ease infinite;
}

.intercept-sep {
  color: #003b00;
  flex-shrink: 0;
}

.intercept-bar-title {
  font-size: 12px;
  font-weight: 600;
  color: #00ff41;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.intercept-bar-by {
  font-size: 10px;
  color: #003b00;
  flex-shrink: 0;
}

.intercept-bar-author {
  font-size: 10px;
  color: #448844;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.intercept-bar-cta {
  font-size: 10px;
  color: #336644;
  letter-spacing: 1px;
  flex-shrink: 0;
  margin-left: 6px;
  animation: ann-warn-pulse 3s ease infinite;
}
.intercept-bar-inner:hover .intercept-bar-cta {
  color: #00cc33;
}

.intercept-bar-dismiss-btn {
  background: none;
  border: none;
  color: #003b00;
  font-family: var(--font-mono);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  flex-shrink: 0;
  transition: color 0.15s;
  line-height: 1;
}
.intercept-bar-dismiss-btn:hover {
  color: #00cc33;
}

