

:root {
  --bg-core: #070709;
  --bg-deep: #000000;
  --bg-surface: #101015;
  --bg-panel: #14141a;
  --bg-card: #181822;
  --bg-card-hover: #1f1f2c;
  --border-subtle: #22222d;
  --border-medium: #2e2e3d;
  --border-bright: #3f3f52;

  --red-primary: #ef4444;
  --red-crimson: #dc2626;
  --red-glow: rgba(239, 68, 68, 0.22);
  --red-pulse: rgba(239, 68, 68, 0.6);
  --green-online: #10b981;
  --amber-warn: #f59e0b;
  --blue-accent: #38bdf8;
  --purple-accent: #a855f7;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-dark: #334155;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-condensed: 'Barlow Condensed', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  width: 100%;
  height: auto !important;
  min-height: 100vh;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y pinch-zoom;
}

body {
  width: 100%;
  min-height: 100vh;
  height: auto !important;
  background: var(--bg-core);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y pinch-zoom;
}


code, pre, .mono {
  font-family: var(--font-mono);
}

body.locked-state,
html.locked-state {
  overflow: hidden !important;
  height: 100% !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
}

body.locked-state #dashboardApp {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#lockScreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100%;
  height: 100dvh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-deep);
  z-index: 9999999;
  user-select: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 300ms ease, transform 300ms ease;
  overflow: hidden;
}

#lockScreen.unlocked {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
  display: none !important;
  z-index: -1 !important;
}

.lock-content {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.lock-welcome {
  font-family: var(--font-condensed);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--text-main);
  text-transform: uppercase;
  margin-bottom: -10px;
}

.lock-logo-img {
  width: 220px;
  max-width: 75vw;
  height: auto;
  filter: drop-shadow(0 0 20px rgba(239, 68, 68, 0.35));
}

.lock-subtitle {
  font-family: var(--font-condensed);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--text-main);
  text-transform: uppercase;
}

.lock-red-dash {
  width: 50px;
  height: 3px;
  background: var(--red-primary);
  margin: 10px auto 0;
  border-radius: var(--radius-full);
}

.fingerprint-btn-wrap {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}

.fingerprint-halo {
  width: 84px;
  height: 84px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.2) 0%, transparent 70%);
  animation: haloPulse 2.4s infinite ease-in-out;
}

@keyframes haloPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { transform: scale(1.08); box-shadow: 0 0 25px 6px rgba(239, 68, 68, 0.2); }
}

.fingerprint-btn {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-full);
  background: #121218;
  border: 2px solid var(--red-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red-primary);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.4);
  transition: transform 0.2s, background 0.2s;
}

.fingerprint-btn svg {
  width: 36px;
  height: 36px;
}

.fingerprint-btn:hover {
  background: #1c1214;
  transform: scale(1.06);
}

.fingerprint-text {
  font-family: var(--font-condensed);
  font-size: 1.05rem;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  font-weight: 700;
  margin-top: 10px;
}

#dashboardApp {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

#systemOfflineBanner {
  display: none;
  background: #7f1d1d;
  color: #ffffff;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 16px 10px;
  text-align: center;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 2px solid #ef4444;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
  z-index: 99999;
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

#systemOfflineBanner.active {
  display: block;
}

body:not(.has-offline-banner) .soc-topbar {
  padding-top: calc(env(safe-area-inset-top, 0px) + 10px);
}

@keyframes bannerFadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

#systemOnlineOverlay {
  position: fixed;
  top: 24px;
  right: 24px;
  background: #064e3b;
  border: 1px solid #10b981;
  color: #ffffff;
  padding: 14px 22px;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.4);
  z-index: 99999;
  display: none;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 0.92rem;
  animation: toastSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#systemOnlineOverlay.show {
  display: flex;
}

@keyframes toastSlide {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.soc-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}

.soc-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.soc-brand-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.desktop-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #09090d;
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
  max-width: 72vw;
}

.desktop-tabs::-webkit-scrollbar {
  display: none;
}

.tab-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.tab-nav-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.tab-nav-btn.active {
  background: var(--red-primary);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.45);
}

.desktop-text {
  display: inline;
}

.mobile-text {
  display: none;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ask-ai-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0.03em;
  background: rgba(250, 204, 21, 0.10);
  border: 1px solid rgba(250, 204, 21, 0.60);
  color: #facc15;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: none;
}

.ask-ai-pill:hover {
  background: #facc15;
  border-color: #facc15;
  color: #111111;
  transform: translateY(-1px);
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.35);
}

.ask-ai-pill svg {
  color: #facc15;
  transition: color 0.2s ease;
}

.ask-ai-pill:hover svg {
  color: #111111;
}

.stream-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--green-online);
  cursor: pointer;
}

.stream-pill.offline {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--red-primary);
}

.stream-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--green-online);
  box-shadow: 0 0 8px var(--green-online);
}

.stream-pill.offline .stream-dot {
  background: var(--red-primary);
  box-shadow: 0 0 8px var(--red-primary);
}

.top-banner-center {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-core);
}

.target-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 22px;
  background: #111118;
  border: 1px solid #292938;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  font-size: 0.92rem;
}

.pulsing-red-dot {
  width: 9px;
  height: 9px;
  border-radius: var(--radius-full);
  background: var(--red-primary);
  box-shadow: 0 0 10px var(--red-primary);
  animation: pulseDot 1.6s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

.main-wrapper {
  flex: 1;
  width: 100%;
  max-width: 1540px;
  margin: 0 auto;
  padding: 0 24px 80px 24px;
}

.view-section {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.soc-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 22px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.panel-header h3 {
  font-size: 1.08rem;
  font-weight: 750;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
}

.kpi-value {
  font-size: 2.1rem;
  font-weight: 850;
  font-family: var(--font-mono);
  color: #ffffff;
}

.kpi-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.charts-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.pie-chart-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  padding: 20px 10px;
  flex-wrap: wrap;
}

.ml-pie-container {
  display: grid;
  grid-template-columns: 240px 1fr;
  align-items: center;
  gap: 40px;
  padding: 24px 20px;
  width: 100%;
}

.donut-disc {
  width: 160px;
  height: 160px;
  border-radius: var(--radius-full);
  background: conic-gradient(var(--red-primary) 0% 65%, var(--blue-accent) 65% 85%, var(--purple-accent) 85% 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 0 28px rgba(0, 0, 0, 0.65);
  margin: 0 auto;
}

.donut-disc::after {
  content: "";
  position: absolute;
  width: 104px;
  height: 104px;
  border-radius: var(--radius-full);
  background: var(--bg-panel);
}

.donut-center-text {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.donut-center-text strong {
  font-size: 1.6rem;
  font-family: var(--font-mono);
  line-height: 1.1;
  color: #ffffff;
}

.donut-center-text span {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-weight: 750;
  letter-spacing: 0.08em;
}

.ml-breakdown-wrapper {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.ml-cat-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  transition: all 0.2s ease;
}

.ml-cat-row:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.ml-cat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.ml-cat-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  color: #f1f5f9;
  min-width: 0;
  flex: 1 1 auto;
}

.ml-cat-stats {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
  white-space: nowrap;
  flex: 0 0 auto;
  margin-left: auto;
}

.ml-cat-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.ml-cat-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 820px) {
  .ml-pie-container {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 16px 8px;
  }
}

.bar-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 6px 0;
}

.bar-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bar-item-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.86rem;
}

.bar-item-name {
  font-weight: 650;
  color: var(--text-main);
}

.bar-item-value {
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.bar-track {
  width: 100%;
  height: 12px;
  background: #12121a;
  border: 1px solid #232334;
  border-radius: var(--radius-full);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
  position: relative;
}

.bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 0;
}

.timeline-chart-container {
  width: 100%;
  min-height: 220px;
  position: relative;
}

.timeline-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.filter-chip-btn {
  background: #1c1c28;
  border: 1px solid var(--border-medium);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.16s ease;
}

.filter-chip-btn:hover {
  color: #fff;
  border-color: var(--border-bright);
}

.filter-chip-btn.active {
  background: var(--red-primary);
  border-color: var(--red-primary);
  color: #fff;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.timeline-summary-bar {
  display: flex;
  gap: 20px;
  padding: 12px 16px;
  background: #101017;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-top: 14px;
  font-size: 0.82rem;
  flex-wrap: wrap;
}

.timeline-summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timeline-summary-item span {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.timeline-summary-item strong {
  font-family: var(--font-mono);
  color: #fff;
}

.map-panel {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 24px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}

.map-viewport-wrapper {
  position: relative;
  width: 100%;
  height: 440px;
  background: #09090e;
  border: 1px solid #1f1f2b;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: grab;
}

.map-viewport-wrapper:active {
  cursor: grabbing;
}

#attackerCanvasMap {
  width: 100%;
  height: 100%;
  display: block;
}

.map-controls-overlay {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
}

.map-btn {
  width: 32px;
  height: 32px;
  background: rgba(18, 18, 24, 0.85);
  border: 1px solid #333345;
  color: #fff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  backdrop-filter: blur(4px);
}

.map-btn:hover {
  background: var(--red-primary);
  border-color: var(--red-primary);
}

.map-legend-overlay {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(16, 16, 22, 0.88);
  border: 1px solid var(--border-medium);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  display: flex;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(4px);
}

.temporal-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 20px;
  margin-top: 16px;
  width: 100%;
}

.intel-card {
  background: #0b0b12;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.intel-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.timeline-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 0.74rem;
  color: var(--text-dim);
}

.timeline-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.timeline-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.hourly-histogram-grid {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 90px;
  padding: 10px 0 4px 0;
  border-bottom: 1px solid #1f1f2e;
}

.hourly-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  position: relative;
  cursor: pointer;
}

.hourly-bar {
  width: 100%;
  border-radius: 2px 2px 0 0;
  min-height: 3px;
  background: #1a1a26;
  transition: height 0.3s ease;
}

.hourly-bar.has-data {
  background: #38bdf8;
}

.hourly-bar.is-peak {
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.7);
}

.hourly-col:hover .hourly-bar {
  filter: brightness(1.3);
}

.hourly-axis-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-top: 4px;
}

.rank-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.rank-row {
  display: grid;
  grid-template-columns: 24px 110px 1fr 60px 48px;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #101018;
  border: 1px solid #1a1a26;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
}

.rank-head {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.7rem;
  text-transform: uppercase;
  padding: 2px 10px;
}

.rank-num {
  color: var(--text-dim);
  font-weight: 700;
}

.rank-main {
  color: #fff;
  font-weight: 700;
}

.rank-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.74rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-cat i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.rank-count {
  color: #ef4444;
  font-weight: 700;
  text-align: right;
}

.rank-share {
  color: var(--text-dim);
  text-align: right;
}

.weekday-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid #1a1a26;
}

.weekday-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.weekday-track {
  width: 100%;
  height: 54px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: #0d0d14;
  border-radius: 3px;
}

.weekday-bar {
  width: 70%;
  background: #38bdf8;
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  transition: height 0.3s ease;
}

.weekday-bar.is-peak {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

.day-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.day-row {
  display: grid;
  grid-template-columns: 1fr 90px 60px;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #101018;
  border: 1px solid #1a1a26;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.day-row.is-peak {
  border-color: rgba(245, 158, 11, 0.45);
}

.day-when {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.day-when strong {
  color: #fff;
  font-size: 0.82rem;
}

.day-when span {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.day-mix {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: #1a1a26;
}

.day-mix i {
  display: block;
  height: 100%;
}

.day-total {
  text-align: right;
  color: #f59e0b;
  font-weight: 700;
}

.timing-footnote {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-dim);
  padding-top: 8px;
  border-top: 1px solid #1a1a26;
  margin-top: 6px;
}

.timing-empty {
  color: var(--text-dim);
  padding: 30px 14px;
  text-align: center;
  font-size: 0.84rem;
}

.map-details-card {
  margin-top: 18px;
  background: #0d0d12;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 18px 22px;
}

.map-details-header {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--red-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.map-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  font-size: 0.84rem;
}

.map-details-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.map-details-item span {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.map-details-item strong {
  color: #fff;
}

.map-disclaimer {
  margin-top: 14px;
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.55;
  border-top: 1px solid #1a1a24;
  padding-top: 10px;
}

.feed-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.feed-filters-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.feed-controls-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-ctrl {
  background: #181824;
  border: 1px solid var(--border-medium);
  color: var(--text-main);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.16s ease;
}

.btn-ctrl:hover {
  border-color: var(--border-bright);
  background: #212132;
}

.btn-ctrl.paused {
  background: var(--amber-warn);
  color: #000;
  border-color: var(--amber-warn);
}

.table-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: #0b0b10;
}

.table-soc {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.84rem;
}

.table-soc th {
  background: #121218;
  color: var(--text-dim);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-medium);
  white-space: nowrap;
}

.table-soc td {
  padding: 12px 14px;
  border-bottom: 1px solid #181822;
  color: var(--text-main);
  vertical-align: middle;
}

.table-soc tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.badge-class {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.03em;
  background: rgba(239, 68, 68, 0.14);
  color: var(--red-primary);
  border: 1px solid rgba(239, 68, 68, 0.35);
  white-space: nowrap;
}

.badge-class.command {
  background: rgba(56, 189, 248, 0.12);
  color: var(--blue-accent);
  border-color: rgba(56, 189, 248, 0.35);
}

.badge-class.malware {
  background: rgba(168, 85, 247, 0.15);
  color: var(--purple-accent);
  border-color: rgba(168, 85, 247, 0.35);
}

.badge-class.session {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
  border-color: rgba(148, 163, 184, 0.35);
}

.btn-inspect {
  background: #1b1b26;
  border: 1px solid var(--border-medium);
  color: #fff;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-inspect:hover {
  background: var(--red-primary);
  border-color: var(--red-primary);
}

.ml-spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.ml-spec-card {
  background: #0f0f15;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 18px;
}

.ml-spec-card span {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ml-spec-card p {
  margin-top: 6px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.btn-download-script {
  background: linear-gradient(135deg, var(--red-crimson), var(--red-primary));
  color: #ffffff;
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 750;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
  transition: all 0.2s ease;
}

.btn-download-script:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.cm-table-wrap {
  width: 100%;
  max-width: 720px;
  margin: 18px auto;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #0b0b10;
  scrollbar-width: thin;
  scrollbar-color: var(--border-medium) transparent;
}

.cm-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  text-align: center;
}

.cm-table th, .cm-table td {
  padding: 16px 14px;
  border: 1px solid #1e1e2c;
  font-size: 0.88rem;
}

.cm-table th {
  background: #12121a;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cm-cell-diag {
  background: rgba(239, 68, 68, 0.28);
  font-weight: 850;
  color: #ffffff;
}

.cm-cell-zero {
  background: #0d0d12;
  color: var(--text-dim);
}

.academy-nav {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 14px 2px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.academy-nav::-webkit-scrollbar {
  height: 4px;
}

.academy-nav::-webkit-scrollbar-thumb {
  background: #252536;
  border-radius: var(--radius-full);
}

.academy-nav-btn {
  background: #111118;
  border: 1px solid var(--border-medium);
  color: var(--text-muted);
  padding: 9px 18px;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.academy-nav-btn:hover {
  color: #fff;
  border-color: var(--border-bright);
}

.academy-nav-btn.active {
  background: var(--red-primary);
  border-color: var(--red-primary);
  color: #fff;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.4);
}

.academy-module {
  display: none;
  animation: fadeIn 0.2s ease-out;
}

.academy-module.active {
  display: block;
}

.academy-card {
  background: #0e0e15;
  border: 1px solid #1f1f2e;
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  margin-bottom: 22px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.academy-card h4 {
  font-size: 1.15rem;
  color: var(--red-primary);
  margin-bottom: 12px;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.academy-card p {
  color: #cbd5e1;
  font-size: 0.9rem;
  line-height: 1.7;
}

.academy-badge-tag {
  display: inline-block;
  background: rgba(239, 68, 68, 0.12);
  color: var(--red-primary);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 750;
  margin-bottom: 12px;
}

.quiz-question-box {
  background: #0e0e15;
  border: 1px solid #242436;
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.quiz-option-btn {
  width: 100%;
  text-align: left;
  background: #14141e;
  border: 1px solid #28283a;
  color: var(--text-main);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-top: 10px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}

.quiz-option-btn:hover {
  background: #1e1e2c;
  border-color: #3b3b52;
}

.quiz-option-btn.selected {
  background: #25181c;
  border-color: var(--red-primary);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.quiz-option-btn.correct {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: var(--green-online) !important;
  color: #ffffff !important;
}

.quiz-option-btn.incorrect {
  background: rgba(239, 68, 68, 0.22) !important;
  border-color: var(--red-primary) !important;
  color: #ffffff !important;
}

.quiz-feedback-box {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  line-height: 1.6;
}

.ai-chat-box {
  display: flex;
  flex-direction: column;
  height: 520px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  background: #08080d;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.ai-chat-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: #101017;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.ai-chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-bubble {
  max-width: 82%;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.6;
}

.chat-bubble.bot {
  background: #13131c;
  border: 1px solid #262638;
  align-self: flex-start;
  color: #e2e8f0;
}

.chat-bubble.user {
  background: var(--red-crimson);
  color: #ffffff;
  align-self: flex-end;
  box-shadow: 0 2px 12px rgba(220, 38, 38, 0.35);
}

.ai-chat-input-bar {
  display: flex;
  padding: 14px;
  background: #111118;
  border-top: 1px solid var(--border-subtle);
  gap: 10px;
}

.ai-chat-input {
  flex: 1;
  background: #060609;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: #fff;
  padding: 12px 16px;
  font-size: 0.9rem;
  font-family: inherit;
}

.ai-chat-input:focus {
  outline: none;
  border-color: var(--red-primary);
}

.soc-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(5px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.soc-modal-backdrop.open {
  display: flex;
}

.soc-modal-content {
  background: #12121a;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.mobile-dock {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #09090e;
  border-top: 1px solid var(--border-subtle);
  padding: 6px 12px calc(env(safe-area-inset-bottom, 0px) + 6px);
  z-index: 999;
  justify-content: space-around;
  backdrop-filter: blur(10px);
}

.dock-link {
  background: transparent;
  border: none;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 6px;
  min-width: 44px;
  min-height: 44px;
}

.dock-link svg {
  width: 20px;
  height: 20px;
}

.dock-link.active {
  color: var(--red-primary);
}

@media (max-width: 1024px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .charts-grid-2col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  html, body {
    font-size: 14px;
  }

  .desktop-text {
    display: none !important;
  }

  .mobile-text {
    display: inline !important;
  }

#systemOfflineBanner {
    background: #7f1d1d;
    box-shadow: none;
    text-shadow: none;
    filter: none;
    animation: none;
    font-size: 0.8rem;
    padding: 8px 12px;
  }

  .soc-topbar {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    background: #09090e !important;
    box-shadow: none;
  }
  #systemOfflineBanner {
    padding: calc(env(safe-area-inset-top, 0px) + 8px) 14px 10px;
    font-size: 0.82rem;
  }

  .desktop-tabs {
    display: none;
  }

  .mobile-dock {
    display: flex;
  }

  .soc-topbar {
    padding: 10px 14px;
    gap: 10px;
  }

  .soc-brand-logo {
    height: 30px;
    max-width: 130px;
  }

  .topbar-controls {
    gap: 8px;
  }

  .stream-pill {
    padding: 5px 12px;
    font-size: 0.74rem;
    gap: 6px;
  }

  .ask-ai-pill {
    padding: 5px 12px;
    font-size: 0.76rem;
    gap: 5px;
  }

  .top-banner-center {
    padding: 10px 14px;
  }

  .target-pill {
    font-size: 0.82rem;
    padding: 6px 16px;
  }

  .main-wrapper {
    padding: 0 12px 90px 12px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .view-section {
    width: 100%;
    max-width: 620px;
    margin: 0 auto;
    box-sizing: border-box;
  }

  .soc-panel {
    width: 100%;
    max-width: 620px;
    margin: 0 auto 16px auto;
    padding: 16px 14px;
    box-sizing: border-box;
  }

  .kpi-card {
    width: 100%;
    box-sizing: border-box;
  }

  .temporal-cards-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    width: 100%;
  }

  .intel-card {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 12px;
  }

  .ml-pie-container {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 20px;
    padding: 14px 6px;
    width: 100%;
    box-sizing: border-box;
  }

  .donut-disc {
    margin: 0 auto;
  }

  .ml-breakdown-wrapper {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
  }

  .ml-cat-row {
    padding: 10px 12px;
    width: 100%;
    box-sizing: border-box;
  }

  .ml-cat-header {
    gap: 12px;
  }

  .ml-cat-name {
    font-size: 0.84rem;
  }

  .ml-cat-stats {
    font-size: 0.82rem;
  }

  .cm-table th, .cm-table td {
    padding: 12px 8px;
    font-size: 0.8rem;
  }

.rank-row {
    grid-template-columns: 18px 84px 1fr 44px;
    gap: 6px;
    padding: 6px 8px;
    font-size: 0.74rem;
    box-sizing: border-box;
    width: 100%;
  }

  .rank-head {
    grid-template-columns: 18px 84px 1fr 44px;
    gap: 6px;
    padding: 2px 8px;
  }

  .rank-share, .rank-share-head {
    display: none !important;
  }

  .hourly-histogram-grid {
    gap: 1.5px;
    overflow: hidden;
    width: 100%;
  }

  .day-row {
    grid-template-columns: 1fr 64px 44px;
    gap: 6px;
    padding: 7px 8px;
    font-size: 0.74rem;
    box-sizing: border-box;
    width: 100%;
  }

  .soc-panel, .intel-card, .temporal-cards-grid, .view-section {
    max-width: 100%;
    overflow: hidden;
    min-width: 0;
  }

  .map-viewport-wrapper {
    height: 320px;
  }
}

@media (max-width: 480px) {
  .soc-topbar {
    padding: 8px 10px;
    gap: 6px;
  }

  .soc-brand-logo {
    height: 26px;
    max-width: 110px;
  }

  .stream-pill {
    padding: 4px 8px;
    font-size: 0.70rem;
    gap: 4px;
  }

  .ask-ai-pill {
    padding: 4px 10px;
    font-size: 0.72rem;
    gap: 4px;
  }

  .lock-welcome {
    font-size: 1.05rem;
    letter-spacing: 0.16em;
    color: var(--text-main);
    margin-bottom: -6px;
  }

  .lock-logo-img {
    width: 180px;
  }

  .lock-subtitle {
    font-size: 1.05rem;
    letter-spacing: 0.16em;
  }
}

@keyframes liveRowFlash {
  0% { background: rgba(56, 189, 248, 0.45); }
  40% { background: rgba(239, 68, 68, 0.35); }
  100% { background: transparent; }
}
.live-row-new {
  animation: liveRowFlash 2.5s ease-out forwards;
}

@keyframes livePulseRadar {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; filter: drop-shadow(0 0 8px #10b981); }
  100% { transform: scale(0.95); opacity: 0.8; }
}
.radar-pulse-active {
  animation: livePulseRadar 1.5s ease-in-out infinite;
}
