body.suricata-standalone {
  margin: 0;
  background-color: #f9f9f9;
  /* default to light */
  transition: background-color 0.3s ease;
}

body.suricata-standalone:not(.light) {
  background-color: #333;
  /* match dark theme */
}

#pysuricata-report {
  --divider-dark: rgba(255, 255, 255, 0.12);
  --divider-light: rgba(0, 0, 0, 0.08);
  --chip-bg-dark: rgba(255, 255, 255, 0.08);
  --chip-bg-light: rgba(0, 0, 0, 0.06);
  --chip-br-dark: rgba(255, 255, 255, 0.12);
  --chip-br-light: rgba(0, 0, 0, 0.08);
  --scroll-track: rgba(0, 0, 0, 0.06);
  --scroll-thumb: rgba(0, 0, 0, 0.28);
  --divider: var(--divider-light);
  --chip-bg: var(--chip-bg-light);
  --chip-br: var(--chip-br-light);
  --appbar-bg-light: rgba(249, 249, 249, 0.86);
  --appbar-bg-dark: rgba(51, 51, 51, 0.90);
  --appbar-bg: var(--appbar-bg-light);
  --anchor-offset: 88px;
  /* offset for in-page anchors under sticky header */
  --triple-left: 240px;
  --triple-right: 240px;

  /* Accent color for interactive elements */
  --accent-color: #3b82f6;
  /* blue-500 */

  /* Boolean Chart Theme Variables */
  --chart-bg-light: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  --chart-bg-dark: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  --chart-border-light: #e2e8f0;
  --chart-border-dark: #374151;
  --chart-shadow-light: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --chart-shadow-dark: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --chart-shadow-hover-light: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --chart-shadow-hover-dark: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);

  --svg-bg-light: white;
  --svg-bg-dark: #1f2937;
  --svg-shadow-light: inset 0 2px 4px rgba(0, 0, 0, 0.06);
  --svg-shadow-dark: inset 0 2px 4px rgba(0, 0, 0, 0.2);

  --segment-stroke-light: rgba(255, 255, 255, 0.2);
  --segment-stroke-dark: rgba(255, 255, 255, 0.1);
  --segment-stroke-hover-light: rgba(255, 255, 255, 0.4);
  --segment-stroke-hover-dark: rgba(255, 255, 255, 0.2);

  --segment-shadow-hover-light: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
  --segment-shadow-hover-dark: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
  --segment-shadow-true-light: drop-shadow(0 4px 8px rgba(16, 185, 129, 0.3));
  --segment-shadow-true-dark: drop-shadow(0 4px 8px rgba(16, 185, 129, 0.4));
  --segment-shadow-false-light: drop-shadow(0 4px 8px rgba(239, 68, 68, 0.3));
  --segment-shadow-false-dark: drop-shadow(0 4px 8px rgba(239, 68, 68, 0.4));
  --segment-shadow-missing-light: drop-shadow(0 4px 8px rgba(107, 114, 128, 0.3));
  --segment-shadow-missing-dark: drop-shadow(0 4px 8px rgba(107, 114, 128, 0.4));

  --label-shadow-light: 0 1px 2px rgba(0, 0, 0, 0.5);
  --label-shadow-dark: 0 1px 2px rgba(0, 0, 0, 0.8);
  --label-shadow-hover-light: 0 2px 4px rgba(0, 0, 0, 0.7);
  --label-shadow-hover-dark: 0 2px 4px rgba(0, 0, 0, 0.9);

  --legend-bg-light: rgba(255, 255, 255, 0.8);
  --legend-bg-dark: rgba(31, 41, 55, 0.8);
  --legend-bg-hover-light: rgba(255, 255, 255, 1);
  --legend-bg-hover-dark: rgba(31, 41, 55, 1);
  --legend-border-light: rgba(0, 0, 0, 0.1);
  --legend-border-dark: rgba(255, 255, 255, 0.1);
  --legend-shadow-hover-light: 0 2px 4px rgba(0, 0, 0, 0.1);
  --legend-shadow-hover-dark: 0 2px 4px rgba(0, 0, 0, 0.3);
  --legend-color-shadow-light: 0 1px 2px rgba(0, 0, 0, 0.2);
  --legend-color-shadow-dark: 0 1px 2px rgba(0, 0, 0, 0.4);
  --legend-text-light: #374151;
  --legend-text-dark: #d1d5db;
}

#pysuricata-report:not(.light) {
  --scroll-track: rgba(255, 255, 255, 0.08);
  --scroll-thumb: rgba(255, 255, 255, 0.32);
  --divider: var(--divider-dark);
  --chip-bg: var(--chip-bg-dark);
  --chip-br: var(--chip-br-dark);
  --appbar-bg: var(--appbar-bg-dark);
}

#pysuricata-report {
  font-family: Arial, sans-serif;
  margin: 20px;
  background-color: #333;
  color: #f9f9f9;
  transition: background-color 0.3s, color 0.3s;
}

#pysuricata-report.light {
  background-color: #f9f9f9;
  color: #333;
}

#pysuricata-report h1 {
  color: inherit;
  margin: 0;
}

/* Global links (content areas). Header nav overrides these to inherit. */
#pysuricata-report a {
  color: #1e90ff;
  text-decoration: none;
}

#pysuricata-report a:hover {
  text-decoration: underline;
}

#pysuricata-report:not(.light) a {
  color: #4ea3f1;
}

/* Tables */
#pysuricata-report table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 20px;
}

#pysuricata-report th,
#pysuricata-report td {
  padding: 8px;
  text-align: left;
  border: 0;
}

#pysuricata-report th {
  background: transparent;
}

#pysuricata-report.light th {
  background: transparent;
}

/* Layout container */
#pysuricata-report .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
}

/* =============================
   HEADER / APP BAR
   ============================= */
#pysuricata-report .appbar {
  background: var(--appbar-bg);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--divider);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background .2s ease, border-color .2s ease;
}

#pysuricata-report.unpinned .appbar {
  position: static;
}

/* 2-row grid, logo spans both rows */
#pysuricata-report .header-grid {
  display: grid;
  grid-template-columns: 80px 1fr;
  /* slightly larger logo column */
  grid-template-rows: auto auto;
  grid-template-areas:
    "logo title"
    "logo meta";
  column-gap: 0.5rem;
  row-gap: 0.2rem;
  /* a touch more breathing room between lines */
  align-items: center;
}

/* Logo */
#pysuricata-report .header-grid .logo {
  grid-area: logo;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
  /* ensure visible area */
  width: 100%;
  background: none !important;
  /* prevent duplicate background logos */
}

/* Ensure embedded logo images render */
#pysuricata-report #logo img {
  height: 60px;
  /* slightly larger image */
  width: auto;
  display: block;
}

/* Default: show light, hide dark */
#pysuricata-report #logo #logo-dark {
  display: none;
}

/* In dark mode, swap visibility */
#pysuricata-report:not(.light) #logo #logo-light {
  display: none;
}

#pysuricata-report:not(.light) #logo #logo-dark {
  display: block;
}

/* Top row: title (left), nav + toggle (right) */
#pysuricata-report .title-nav {
  grid-area: title;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

#pysuricata-report .title-nav h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

#pysuricata-report .nav-and-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Quick links - minimal clean design with no default background */
#pysuricata-report .quick {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

#pysuricata-report .quick a,
#pysuricata-report .quick a:visited {
  color: inherit !important;
  text-decoration: none !important;
}

#pysuricata-report .quick a {
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  background: transparent;
  transition: all 0.2s ease;
  position: relative;
}

/* Hover state - subtle background only, no border, no underline */
#pysuricata-report .quick a:hover {
  background: rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
  text-decoration: none;
}

#pysuricata-report:not(.light) .quick a:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Active state - shows current section */
#pysuricata-report .quick a.active {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  text-decoration: none;
}

#pysuricata-report:not(.light) .quick a.active {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
}

/* Focus state - accessibility */
#pysuricata-report .quick a:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Toggle button (monochrome) */
#pysuricata-report .appbar .toggle-button {
  position: static;
  border: none;
  background: transparent;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 50%;
  color: inherit;
  transition: background-color 0.2s, transform 0.2s;
}

#pysuricata-report .appbar .toggle-button:hover {
  background-color: rgba(0, 0, 0, 0.08);
  transform: scale(1.1);
}

#pysuricata-report:not(.light) .appbar .toggle-button:hover {
  background-color: rgba(255, 255, 255, 0.12);
}

/* Bottom row: metadata left-aligned under title */
#pysuricata-report .meta {
  grid-area: meta;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  opacity: 0.9;
}


/* Pin button placement and hover styling */
#pysuricata-report .meta #pin-button {
  margin-left: auto;
}

#pysuricata-report .icon-btn:hover {
  background: var(--chip-bg);
  filter: brightness(1.05);
}

#pysuricata-report .icon-btn:focus-visible {
  outline: 2px solid #4ea3f1;
  outline-offset: 2px;
}

#pysuricata-report #pin-button {
  border: none;
}


#pysuricata-report .chip {
  padding: 0.35rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  line-height: 1;
  background: var(--chip-bg-light);
  border: 1px solid var(--chip-br-light);
}

#pysuricata-report:not(.light) .chip {
  background: var(--chip-bg-dark);
  border-color: var(--chip-br-dark);
}

/* Responsive header tweaks */
@media (max-width: 800px) {
  #pysuricata-report .title-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
}

@media (max-width: 560px) {
  #pysuricata-report .header-grid {
    grid-template-columns: 66px 1fr;
  }

  #pysuricata-report .header-grid .logo img {
    height: 50px;
  }
}

#pysuricata-report .icon-btn {
  border: 1px solid var(--chip-br-light);
  background: transparent;
  border-radius: 9999px;
  width: 32px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: inherit;
  /* SVGs use currentColor */
  transition: color .25s ease, background-color .2s ease, transform .12s ease;
}

#pysuricata-report:not(.light) .icon-btn {
  border-color: var(--chip-br-dark);
}

/* =============================
   SUMMARY SECTION (cards & lists)
   ============================= */
#pysuricata-report #summary {
  margin: 0.05rem 0 0.05rem;
}

#pysuricata-report #summary h2 {
  margin: 0 0 .75rem;
  font-size: 1.25rem;
  line-height: 1.25;
}

#pysuricata-report #summary .summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

#pysuricata-report #summary .summary-grid.second-row {
  margin-top: 12px;
}

/* Auto-dense 3-column layout for second row */
#pysuricata-report #summary .summary-grid.second-row {
  grid-auto-flow: dense;
  /* allow items to backfill gaps */
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

@media (max-width: 960px) {
  #pysuricata-report #summary .summary-grid.second-row {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

#pysuricata-report #summary .summary-card {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--chip-br-light);
  background: rgba(0, 0, 0, 0.02);
}

/* First row cards - keep compact */
#pysuricata-report #summary .summary-grid:not(.second-row) .summary-card {
  display: block;
}

/* Only apply min-height to second-row cards (Column types, Top missing, Quick insights) */
#pysuricata-report #summary .summary-grid.second-row .summary-card {
  min-height: 280px;
  display: flex;
  flex-direction: column;
}

/* Better space distribution for Column types card */
#pysuricata-report #summary .summary-grid.second-row .summary-card:first-child {
  justify-content: space-between;
}

#pysuricata-report:not(.light) #summary .summary-card {
  border-color: var(--chip-br-dark);
  background: rgba(255, 255, 255, 0.04);
}

#pysuricata-report #summary .summary-card .label {
  font-size: .8rem;
  opacity: .8;
  margin: 0 0 12px;
}

#pysuricata-report #summary .summary-card .value {
  font-weight: 600;
  font-size: 1.1rem;
}

/* Generic summary list (two-column rows). We EXCLUDE .top-missing here. */
#pysuricata-report #summary .summary-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  row-gap: 4px;
}

#pysuricata-report #summary .summary-list:not(.top-missing) li {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#pysuricata-report #summary .summary-list:not(.top-missing) li span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =============================
   TOP MISSING COLUMNS (bars)
   ============================= */
/* The UL wrapper */
#pysuricata-report #summary .summary-list.top-missing {
  display: flex !important;
  flex-direction: column;
  justify-content: flex-start;
  /* do not stretch gaps between items */
  align-content: flex-start;
  gap: 16px;
  /* uniform vertical spacing between rows */
  margin: 0;
  padding: 0;
}

/* Each LI is a 2-row grid: info row + bar row */
#pysuricata-report .top-missing .missing-item {
  display: grid !important;
  grid-template-rows: auto 8px;
  row-gap: 4px;
  list-style: none;
}

/* Expandable content styling */
#pysuricata-report .top-missing .expandable-content {
  display: none;
}

#pysuricata-report .top-missing .expandable-content .missing-item {
  opacity: 0.9;
}

/* Expand button styling */
#pysuricata-report .expand-btn {
  background: transparent;
  border: 1px solid var(--chip-br-light);
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  width: 100%;
  justify-content: center;
}

#pysuricata-report:not(.light) .expand-btn {
  border-color: var(--chip-br-dark);
}

#pysuricata-report .expand-btn:hover {
  background: var(--chip-bg);
  border-color: var(--accent-color);
  transform: translateY(-1px);
}

#pysuricata-report .expand-btn:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

#pysuricata-report .expand-icon {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

#pysuricata-report .expand-btn[data-expanded="true"] .expand-icon {
  transform: rotate(180deg);
}

/* Expand controls container */
#pysuricata-report .expand-controls {
  margin-top: 0.5rem;
  list-style: none;
}

/* Info row: column name (left) + count/percent (right) */
#pysuricata-report .missing-info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin: 0;
}

/* Column name chip (code-like) */
#pysuricata-report .missing-col {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: inherit;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#pysuricata-report:not(.light) .missing-col {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}

#pysuricata-report .missing-stats {
  font-weight: 500;
  white-space: nowrap;
}

/* Bar container */
#pysuricata-report .missing-bar {
  position: relative;
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.05));
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

#pysuricata-report:not(.light) .missing-bar {
  background: linear-gradient(to right, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.05));
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.08);
}

/* Percentage fill. Width is set inline: style="width: 23.4%;" */
#pysuricata-report .missing-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  display: block;
  transition: all 0.3s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#pysuricata-report .missing-fill.low {
  background: linear-gradient(to right, #4ea3f1, #5db3ff);
  box-shadow: 0 1px 3px rgba(78, 163, 241, 0.4);
}

#pysuricata-report .missing-fill.medium {
  background: linear-gradient(to right, #f1c54e, #f5d165);
  box-shadow: 0 1px 3px rgba(241, 197, 78, 0.4);
}

#pysuricata-report .missing-fill.high {
  background: linear-gradient(to right, #f15e4e, #f57365);
  box-shadow: 0 1px 3px rgba(241, 94, 78, 0.4);
}

/* Hover effects for missing bars */
#pysuricata-report .missing-item:hover .missing-fill {
  transform: scaleY(1.1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#pysuricata-report .missing-item:hover .missing-fill.low {
  box-shadow: 0 2px 4px rgba(78, 163, 241, 0.6);
}

#pysuricata-report .missing-item:hover .missing-fill.medium {
  box-shadow: 0 2px 4px rgba(241, 197, 78, 0.6);
}

#pysuricata-report .missing-item:hover .missing-fill.high {
  box-shadow: 0 2px 4px rgba(241, 94, 78, 0.6);
}

/* Dark mode adjustments for missing fills */
#pysuricata-report:not(.light) .missing-fill.low {
  background: linear-gradient(to right, #3b8ad1, #4a9ae1);
}

#pysuricata-report:not(.light) .missing-fill.medium {
  background: linear-gradient(to right, #d1a53e, #e1b54e);
}

#pysuricata-report:not(.light) .missing-fill.high {
  background: linear-gradient(to right, #d14e3e, #e15e4e);
}

/* =============================
   COLUMN TYPES (pretty tiles)
   ============================= */
/* Target the first card in the second summary row ("Column types") */
#pysuricata-report #summary .summary-grid.second-row .summary-card:first-child .summary-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

/* Turn each LI into a compact tile */
#pysuricata-report #summary .summary-grid.second-row .summary-card:first-child .summary-list li {
  display: flex !important;
  /* override default two-column row */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 10px;
  border-radius: 10px;
  border: 1px solid var(--chip-br-light);
  background: rgba(0, 0, 0, 0.02);
  transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease;
}

#pysuricata-report:not(.light) #summary .summary-grid.second-row .summary-card:first-child .summary-list li {
  border-color: var(--chip-br-dark);
  background: rgba(255, 255, 255, 0.04);
}

#pysuricata-report #summary .summary-grid.second-row .summary-card:first-child .summary-list li:hover {
  transform: translateY(-1px);
  background: rgba(0, 0, 0, 0.04);
}

#pysuricata-report:not(.light) #summary .summary-grid.second-row .summary-card:first-child .summary-list li:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Color swatch before each tile (matches donut palette) */
#pysuricata-report #summary .summary-grid.second-row .summary-card:first-child .summary-list li::before {
  content: "";
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  margin-bottom: 6px;
  border: 1px solid var(--chip-br-light);
}

#pysuricata-report:not(.light) #summary .summary-grid.second-row .summary-card:first-child .summary-list li::before {
  border-color: var(--chip-br-dark);
}

#pysuricata-report #summary .summary-grid.second-row .summary-card:first-child .summary-list li:nth-child(1)::before {
  background: #4ea3f1;
}

/* Numeric */
#pysuricata-report #summary .summary-grid.second-row .summary-card:first-child .summary-list li:nth-child(2)::before {
  background: #8ac926;
}

/* Categorical */
#pysuricata-report #summary .summary-grid.second-row .summary-card:first-child .summary-list li:nth-child(3)::before {
  background: #ffca3a;
}

/* Datetime */
#pysuricata-report #summary .summary-grid.second-row .summary-card:first-child .summary-list li:nth-child(4)::before {
  background: #ff595e;
}

/* Boolean */

/* Label (left span) becomes a subtle caption; value (right span) is bold/bigger */
#pysuricata-report #summary .summary-grid.second-row .summary-card:first-child .summary-list li span:first-child {
  order: 2;
  /* place under the value */
  font-size: 0.8rem;
  opacity: 0.8;
}

#pysuricata-report #summary .summary-grid.second-row .summary-card:first-child .summary-list li span:last-child {
  order: 1;
  /* show the number on top */
  font-weight: 700;
  font-size: 1.2rem;
}

/* Responsive: stack to 2 columns on narrow screens */
@media (max-width: 560px) {
  #pysuricata-report #summary .summary-grid.second-row .summary-card:first-child .summary-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =============================
   QUICK INSIGHTS (chip wall)
   ============================= */
#pysuricata-report .chip-wall {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

#pysuricata-report .chip-wall li {
  padding: 0.3rem 0.6rem;
  border-radius: 9999px;
  background: var(--chip-bg-light);
  border: 1px solid var(--chip-br-light);
}

#pysuricata-report:not(.light) .chip-wall li {
  background: var(--chip-bg-dark);
  border-color: var(--chip-br-dark);
}

#pysuricata-report .quick a svg {
  vertical-align: text-bottom;
  margin-right: 0px;
}

/* =============================
   DTYPE PIE CHART SVG (interactive with custom tooltips)
   Full pie slices from center to edge with lighter inner overlay
   ============================= */
#pysuricata-report .dtype-donut-svg {
  display: block;
  margin: 8px auto;
  cursor: pointer;
  border-radius: 50%;
  overflow: visible;
}

/* Background circle - ensures complete appearance */
#pysuricata-report .donut-background {
  fill: #f0f0f0;
  opacity: 0.15;
}

#pysuricata-report:not(.light) .donut-background {
  fill: #555;
  opacity: 0.2;
}

/* Segment hover effects - highlight on hover */
#pysuricata-report .segment-path {
  transition: all 0.2s ease;
  cursor: pointer;
}

#pysuricata-report .segment-path:hover {
  opacity: 0.85;
  filter: brightness(1.15);
  stroke: rgba(255, 255, 255, 0.6);
  stroke-width: 2;
}

/* Dark mode - adjust stroke color for hover */
#pysuricata-report:not(.light) .segment-path:hover {
  stroke: rgba(255, 255, 255, 0.4);
}

/* Inner segments - subtle overlay matching original CSS exactly */
#pysuricata-report .segment-inner {
  fill: rgba(0, 0, 0, 0.06);
  pointer-events: none;
  transition: fill 0.2s ease;
}

#pysuricata-report:not(.light) .segment-inner {
  fill: rgba(255, 255, 255, 0.08);
}

/* Center circle - subtle background color */
#pysuricata-report .donut-center {
  fill: var(--chip-bg-light);
}

#pysuricata-report:not(.light) .donut-center {
  fill: var(--chip-bg-dark);
}

/* Custom Donut Chart Tooltip - Matches Histogram Style */
#pysuricata-report .donut-tooltip {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
  display: none;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(20, 20, 20, 0.92);
  color: #fff;
  font-size: .85rem;
  line-height: 1.4;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
}

#pysuricata-report.light .donut-tooltip {
  background: rgba(255, 255, 255, 0.96);
  color: #111;
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

#pysuricata-report .donut-tooltip .type-label {
  font-weight: 700;
  font-size: 0.9rem;
}

#pysuricata-report .donut-tooltip .type-stats {
  font-size: 0.8rem;
}

#pysuricata-report .donut-tooltip .line {
  margin: 2px 0;
}

#pysuricata-report .donut-tooltip .muted {
  opacity: .75;
}

/* Legacy: Hide old dtype-legend if it exists */
#pysuricata-report .dtype-legend {
  display: none !important;
}

/* =============================
   DATASET SAMPLE (collapsible card)
   ============================= */
#pysuricata-report .collapsible-card {
  margin: 0.05rem 0 0.05rem;
}

#pysuricata-report details.card {
  border: 1px solid var(--chip-br-light);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.02);
}

#pysuricata-report:not(.light) details.card {
  border-color: var(--chip-br-dark);
  background: rgba(255, 255, 255, 0.04);
}

#pysuricata-report details.card>summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
  border-radius: 10px;
  transition: background-color 0.2s ease;
}

#pysuricata-report details.card>summary::-webkit-details-marker {
  display: none;
}

/* Hover states inherit border-radius from base state */
#pysuricata-report details.card>summary:hover {
  background: rgba(0, 0, 0, 0.06);
}

#pysuricata-report:not(.light) details.card>summary:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* When details is open, summary should only have top rounded corners */
#pysuricata-report details.card[open]>summary {
  border-radius: 10px 10px 0 0;
}

/* Hover state when details is open inherits border-radius from open state */
#pysuricata-report details.card[open]>summary:hover {
  background: rgba(0, 0, 0, 0.06);
}

#pysuricata-report:not(.light) details.card[open]>summary:hover {
  background: rgba(255, 255, 255, 0.06);
}

#pysuricata-report .chev {
  transition: transform 0.2s ease;
}

#pysuricata-report details[open] .chev {
  transform: rotate(90deg);
}

#pysuricata-report details.card>.card-content {
  padding: 12px 14px;
  border-top: 1px solid var(--divider-light);
  border-radius: 0 0 10px 10px;
}

#pysuricata-report:not(.light) details.card>.card-content {
  border-top-color: var(--divider-dark);
}

#pysuricata-report .sample-scroll {
  overflow-x: auto;
  /* allow horizontal scroll if needed */
  overflow-y: visible;
  /* remove vertical scrolling within the section */
  max-width: 100%;
  max-height: none;
  /* expand to fit content vertically */
  -webkit-overflow-scrolling: touch;
  border: none;
  background: white;
  margin: 8px 0 0 0;
  /* Remove bottom margin to eliminate extra padding */
}

#pysuricata-report:not(.light) .sample-scroll {
  background: #1a1a1a;
}

/* Theme-aware horizontal scrollbar styling for sample area */
#pysuricata-report .sample-scroll {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}

#pysuricata-report .sample-scroll::-webkit-scrollbar {
  height: 10px;
}

#pysuricata-report .sample-scroll::-webkit-scrollbar-track {
  background: var(--scroll-track);
}

#pysuricata-report .sample-scroll::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

#pysuricata-report .sample-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.45);
}

#pysuricata-report:not(.light) .sample-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.45);
}

/* =============================================
   SAMPLE TABLE - MATCHING REPORT STYLE
   ============================================= */

/* Sample table styling that matches the main report typography and design */
#pysuricata-report table.sample-table {
  border-collapse: collapse;
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.65rem;
  /* Further reduced for better proportion */
  line-height: 1.3;
  /* Reduced from 1.4 for tighter spacing */
  background: white;
  border: none;
  /* Removed border for cleaner look */
}

#pysuricata-report:not(.light) table.sample-table {
  background: #1a1a1a;
  color: #e0e0e0;
}

/* Column headers - clean table styling without chips */
#pysuricata-report table.sample-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(0, 0, 0, 0.02);
  color: inherit;
  font-weight: 600;
  font-size: 0.8rem;
  /* Increased for better readability */
  padding: 3px 8px;
  /* Reduced padding for tighter spacing */
  border: 1px solid var(--chip-br-light);
  border-bottom: 2px solid var(--chip-br-light);
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

#pysuricata-report:not(.light) table.sample-table thead th {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--chip-br-dark);
  border-bottom-color: var(--chip-br-dark);
}

/* Row number column header - same styling as other headers */
#pysuricata-report table.sample-table thead th:first-child {
  background: rgba(0, 0, 0, 0.02);
  text-align: center;
  width: 50px;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

#pysuricata-report:not(.light) table.sample-table thead th:first-child {
  background: rgba(255, 255, 255, 0.04);
}

/* Table cells with proper spacing */
#pysuricata-report table.sample-table td {
  padding: 6px 12px;
  border: 1px solid var(--chip-br-light);
  font-size: 0.85rem;
  line-height: 1.3;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  /* Use monospace for all cells */
}

#pysuricata-report:not(.light) table.sample-table td {
  border-color: var(--chip-br-dark);
}

/* Numeric columns - match row number column styling */
#pysuricata-report table.sample-table td {
  text-align: left;
  /* Default alignment */
}

#pysuricata-report table.sample-table td span.num {
  display: inline;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.8rem;
}

/* Right-align cells containing numerical values */
#pysuricata-report table.sample-table td:has(span.num) {
  text-align: right;
}

#pysuricata-report:not(.light) table.sample-table td span.num {
  /* Background removed - no longer needed */
}

/* Row numbering - match report styling */
#pysuricata-report table.sample-table tbody td:first-child {
  background: rgba(0, 0, 0, 0.02);
  color: #666;
  font-weight: 500;
  text-align: center;
  width: 50px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.8rem;
  border-right: 2px solid var(--chip-br-light);
}

#pysuricata-report:not(.light) table.sample-table tbody td:first-child {
  background: rgba(255, 255, 255, 0.05);
  color: #999;
  border-right-color: var(--chip-br-dark);
}


/* Subtle zebra striping for readability */
#pysuricata-report table.sample-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}

#pysuricata-report:not(.light) table.sample-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

/* Minimal hover effect - match report styling */
#pysuricata-report table.sample-table tbody tr:hover {
  background: rgba(0, 0, 0, 0.04);
}

#pysuricata-report:not(.light) table.sample-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Make Sample card title match the Summary h2 size */
#pysuricata-report details.card>summary>span:first-child {
  font-size: 0.8rem;
  opacity: 0.8;
  font-weight: normal;
}

/* === SVG Histogram Styles === */
#pysuricata-report .hist-svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

#pysuricata-report .hist-svg .bar {
  cursor: pointer;
  transition: fill-opacity 0.2s ease, stroke-width 0.2s ease;
}

#pysuricata-report .hist-svg .bar:hover {
  fill-opacity: 0.9;
  stroke-width: 1.5;
}

#pysuricata-report .hist-svg .tick-label {
  user-select: none;
  pointer-events: none;
}

#pysuricata-report .hist-svg .hist-title {
  font-weight: 600;
  fill: currentColor;
}

#pysuricata-report .hist-svg .hist-empty {
  font-style: italic;
  opacity: 0.7;
}

/* Dark mode adjustments for SVG histograms */
#pysuricata-report:not(.light) .hist-svg .tick-label {
  fill: #ccc;
}

#pysuricata-report:not(.light) .hist-svg .hist-title {
  fill: #f9f9f9;
}

#pysuricata-report:not(.light) .hist-svg .hist-empty {
  fill: #999;
}

/* Ensure SVG histograms work with existing tooltip system */
#pysuricata-report .hist-svg .bar[data-count] {
  /* This ensures the existing tooltip JavaScript can find these elements */
}

/*# =============================
#    NUMERIC VARIABLES – OUTSIDE DROPDOWNS
#    Cards, badges, mini-viz, and CSS-only toggles
# ============================= */
#pysuricata-report #vars {
  margin: 0.05rem 0;
}

#pysuricata-report #vars .section-title {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  line-height: 1.25;
  font-weight: 700;
}

/* Toolbar: search + toggles container */
#pysuricata-report .var-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

#pysuricata-report .var-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

#pysuricata-report .var-search input[type="search"] {
  appearance: none;
  -webkit-appearance: none;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--chip-br-light);
  background: rgba(0, 0, 0, 0.02);
  color: inherit;
  min-width: 220px;
}

#pysuricata-report:not(.light) .var-search input[type="search"] {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--chip-br-dark);
}

#pysuricata-report .var-search input[type="search"]::placeholder {
  opacity: .7;
}

/* Grid of variable cards */
#pysuricata-report .var-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

/* Card */
#pysuricata-report .var-card {
  border: 1px solid var(--chip-br-light);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.02);
  padding: 10px 12px;
  transition: background-color .2s ease, transform .12s ease;
  isolation: isolate;
  /* keep absolutely/stacked children inside this card */
}

#pysuricata-report:not(.light) .var-card {
  border-color: var(--chip-br-dark);
  background: rgba(255, 255, 255, 0.04);
}

#pysuricata-report .var-card:hover {
  background: rgba(0, 0, 0, 0.04);
  transform: translateY(-1px);
}

#pysuricata-report:not(.light) .var-card:hover {
  background: rgba(255, 255, 255, 0.06);
}

#pysuricata-report .var-card .head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

#pysuricata-report .var-card .title {
  font-weight: 700;
  font-size: 1rem;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#pysuricata-report .var-card .dtype {
  font-size: .78rem;
  opacity: .8;
}

/* Stat badges row (count, missing %, unique, zeros %, negatives %, outliers) */
#pysuricata-report .stat-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}

#pysuricata-report .stat-badges li {
  padding: 0.28rem 0.5rem;
  border-radius: 9999px;
  background: var(--chip-bg-light);
  border: 1px solid var(--chip-br-light);
  font-size: .8rem;
  line-height: 1;
}

#pysuricata-report:not(.light) .stat-badges li {
  background: var(--chip-bg-dark);
  border-color: var(--chip-br-dark);
}

#pysuricata-report .stat-badges li.crit {
  border-color: #f15e4e;
}

#pysuricata-report .stat-badges li.warn {
  border-color: #f1c54e;
}

#pysuricata-report .stat-badges li.good {
  border-color: #8ac926;
}

/* Hide numeric header chips */
#pysuricata-report .stat-badges {
  display: none !important;
}

/* Mini-viz area */
#pysuricata-report .viz {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#pysuricata-report .viz .caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: .8rem;
  opacity: .85;
}

/* CSS-only tabstrip for Histogram / ECDF (and presets) using :has() */
#pysuricata-report .viz-tabs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#pysuricata-report .viz-tabs .tab-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

#pysuricata-report .viz-tabs input[type="radio"],
#pysuricata-report .viz-tabs input[type="checkbox"] {
  display: none;
}

#pysuricata-report .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 9999px;
  cursor: pointer;
  border: 1px solid var(--chip-br-light);
  background: var(--chip-bg-light);
  font-size: .8rem;
}

#pysuricata-report:not(.light) .pill {
  border-color: var(--chip-br-dark);
  background: var(--chip-bg-dark);
}

#pysuricata-report .pill:hover {
  filter: brightness(1.05);
}

#pysuricata-report .pill .kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: .75rem;
  opacity: .8;
}

/* Panels swapping with :has() */
#pysuricata-report .viz-tabs .panels {
  position: relative;
}

#pysuricata-report .viz-tabs .panel {
  display: none;
}

/* Expect structure: [input.hist] [label] [input.ecdf] [label] [input.lin] [label] [input.log] [label] .panels > (.hist, .ecdf) */
#pysuricata-report .viz-tabs:has(.hist-toggle:checked) .panel.hist {
  display: block;
}

#pysuricata-report .viz-tabs:has(.ecdf-toggle:checked) .panel.ecdf {
  display: block;
}

/* Scale toggles can swap pre-rendered SVGs via data-attrs on the .panel children */
#pysuricata-report .svg-swap>.view {
  display: none;
}

#pysuricata-report .viz-tabs:has(.scale-lin:checked) .svg-swap>.view[data-scale="lin"] {
  display: block;
}

#pysuricata-report .viz-tabs:has(.scale-log:checked) .svg-swap>.view[data-scale="log"] {
  display: block;
}

/* Binning toggles (10/20/50) showing the matching pre-rendered histogram */
#pysuricata-report .svg-swap>.view[data-bins] {
  display: none;
}

#pysuricata-report .viz-tabs:has(.bins-10:checked) .svg-swap>.view[data-bins="10"] {
  display: block;
}

#pysuricata-report .viz-tabs:has(.bins-20:checked) .svg-swap>.view[data-bins="20"] {
  display: block;
}

#pysuricata-report .viz-tabs:has(.bins-50:checked) .svg-swap>.view[data-bins="50"] {
  display: block;
}

/* Stats table inside card */
#pysuricata-report .stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  font-variant-numeric: tabular-nums;
}

#pysuricata-report .stats-grid .label {
  opacity: .75;
}

#pysuricata-report .stats-grid .value {
  text-align: right;
  font-weight: 600;
}

@media (min-width: 760px) {
  #pysuricata-report .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Legacy correlation table styles removed - using .correlations-table.enhanced instead */

/* Helper: muted small text and numeric alignment */
#pysuricata-report .muted {
  opacity: .8;
}

#pysuricata-report .small {
  font-size: .85rem;
}

#pysuricata-report .tabular {
  font-variant-numeric: tabular-nums;
}

/* =============================
   ACCESSIBILITY & FOCUS
   ============================= */
#pysuricata-report .pill:focus-visible,
#pysuricata-report .var-search input[type="search"]:focus-visible,
#pysuricata-report .var-card:focus-within {
  outline: 2px solid #4ea3f1;
  outline-offset: 2px;
}

/* =============================
   OPTIONAL: sticky column actions row for wide screens
   ============================= */
@media (min-width: 960px) {
  #pysuricata-report .var-card .actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
  }
}

/* =============================
   NUMERIC TABLE VIEW (one row per column)
   ============================= */
#pysuricata-report .wide-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#pysuricata-report table.var-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

#pysuricata-report table.var-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--chip-bg-light);
  border: 1px solid var(--chip-br-light);
  text-align: left;
  padding: 8px 10px;
}

#pysuricata-report:not(.light) table.var-table thead th {
  background: var(--chip-bg-dark);
  border-color: var(--chip-br-dark);
}

#pysuricata-report table.var-table tbody td,
#pysuricata-report table.var-table tbody th {
  border: 1px solid var(--chip-br-light);
  padding: 6px 8px;
  vertical-align: middle;
}

#pysuricata-report:not(.light) table.var-table tbody td,
#pysuricata-report:not(.light) table.var-table tbody th {
  border-color: var(--chip-br-dark);
}

#pysuricata-report table.var-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}

#pysuricata-report:not(.light) table.var-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

#pysuricata-report table.var-table tbody tr:hover {
  background: rgba(0, 0, 0, 0.04);
}

#pysuricata-report:not(.light) table.var-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Name + dtype chip in first column */
#pysuricata-report .var-table .colname {
  display: flex;
  align-items: center;
  gap: 8px;
}

#pysuricata-report .var-table .dtype {
  font-size: .78rem;
  opacity: .85;
}

/* Right-align numeric cells */
#pysuricata-report .var-table td.num {
  text-align: right;
  white-space: nowrap;
}

/* Threshold highlights */
#pysuricata-report .var-table td.warn {
  background: rgba(241, 197, 78, 0.18);
}

#pysuricata-report .var-table td.crit {
  background: rgba(241, 94, 78, 0.18);
  font-weight: 700;
}

/* (Removed sparkline sizing/styles; no longer used) */


/* Map generic tokens used by the HTML to current theme vars */
#pysuricata-report {
  --border-color: var(--chip-br-light);
  --axis: rgba(0, 0, 0, 0.45);
  --axis-text: rgba(0, 0, 0, 0.65);
  --bar: #60a5fa;
}

#pysuricata-report:not(.light) {
  --border-color: var(--chip-br-dark);
  --axis: rgba(255, 255, 255, 0.55);
  --axis-text: rgba(255, 255, 255, 0.75);
  --bar: #93c5fd;
}

/* Section title used by numeric section */
#pysuricata-report .section-title {
  margin: 0 0 .75rem;
  font-size: 1.25rem;
  line-height: 1.25;
  font-weight: 700;
}

/* Grid that holds the per-column cards */
#pysuricata-report .cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(520px, 1fr));
  gap: 16px;
}

/* Card header/body blocks added by report.py */
#pysuricata-report .var-card__header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#pysuricata-report .var-card__header .title {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#pysuricata-report .var-card__header .dtype {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--chip-bg-light);
  border: 1px solid var(--chip-br-light);
}

#pysuricata-report:not(.light) .var-card__header .dtype {
  background: var(--chip-bg-dark);
  border-color: var(--chip-br-dark);
}

#pysuricata-report .var-card__header .badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(96, 165, 250, .16);
  color: #3b82f6;
  border: 1px solid rgba(96, 165, 250, .35);
}

#pysuricata-report .var-card__body {
  display: block;
  /* let the inner .triple-row control layout */
  padding: 12px 14px;
}

/* Semantic numeric coloring retained */
#pysuricata-report td.num.warn {
  color: #d97706;
}

#pysuricata-report td.num.crit {
  color: #dc2626;
}

#pysuricata-report td.num.good {
  color: #16a34a;
}


/* =============================================
   Numeric cards: one per row, match container width
   ============================================= */
#pysuricata-report #vars .cards-grid {
  display: grid;
  grid-auto-flow: row;
  grid-template-columns: minmax(0, 1fr) !important;
  /* ensure track uses full container width */
  justify-items: stretch;
  /* stretch items to the track width */
  align-items: stretch;
  gap: 16px;
  margin-left: 0;
  margin-right: 0;
}

#pysuricata-report #vars .cards-grid>.var-card {
  width: 100% !important;
  max-width: none !important;
  /* remove any max-width constraints */
  box-sizing: border-box;
  /* borders/padding included */
}

/* # =============================================
#    Numeric card – Details section & column name chip styling
# =============================================*/

/* Make the column name in the card header look like the top-missing chip */
#pysuricata-report .var-card__header .colname {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: inherit;
  max-width: 60ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#pysuricata-report:not(.light) .var-card__header .colname {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}



/* === SVG Histogram Styles === */
#pysuricata-report .hist-svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

#pysuricata-report .hist-svg .bar {
  cursor: pointer;
  transition: fill-opacity 0.2s ease, stroke-width 0.2s ease;
}

#pysuricata-report .hist-svg .bar:hover {
  fill-opacity: 0.9;
  stroke-width: 1.5;
}

#pysuricata-report .hist-svg .tick-label {
  user-select: none;
  pointer-events: none;
}

#pysuricata-report .hist-svg .hist-title {
  font-weight: 600;
  fill: currentColor;
}

#pysuricata-report .hist-svg .hist-empty {
  font-style: italic;
  opacity: 0.7;
}

/* Dark mode adjustments for SVG histograms */
#pysuricata-report:not(.light) .hist-svg .tick-label {
  fill: #ccc;
}

#pysuricata-report:not(.light) .hist-svg .hist-title {
  fill: #f9f9f9;
}

#pysuricata-report:not(.light) .hist-svg .hist-empty {
  fill: #999;
}

/* Ensure SVG histograms work with existing tooltip system */
#pysuricata-report .hist-svg .bar[data-count] {
  /* This ensures the existing tooltip JavaScript can find these elements */
}

/*# =====================================================
#   Chip polish — unified look, header-compact variant, better colors
#   ===================================================== # */

/* Base quality chips */
#pysuricata-report .quality-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 2px 0 0;
}

#pysuricata-report .quality-flags .flag {
  padding: 0.28rem 0.55rem;
  border-radius: 9999px;
  border: 1px solid var(--chip-br-light);
  background: var(--chip-bg-light);
  font-size: .8rem;
  line-height: 1;
  white-space: nowrap;
}

#pysuricata-report:not(.light) .quality-flags .flag {
  border-color: var(--chip-br-dark);
  background: var(--chip-bg-dark);
}

/* Semantic colors — subtle backgrounds for emphasis */
#pysuricata-report .quality-flags .flag.bad {
  border-color: #f15e4e;
  background: rgba(241, 94, 78, .12);
}

#pysuricata-report .quality-flags .flag.warn {
  border-color: #f1c54e;
  background: rgba(241, 197, 78, .12);
}

#pysuricata-report .quality-flags .flag.good {
  border-color: #8ac926;
  background: rgba(138, 201, 38, .12);
}

/* Enhanced hover state for all flags (tooltip system handles them) */
#pysuricata-report .quality-flags .flag {
  cursor: help;
  transition: all 0.2s ease;
}

#pysuricata-report .quality-flags .flag:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

#pysuricata-report:not(.light) .quality-flags .flag:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Code-style tokens inside chips (e.g., correlated column names) */
#pysuricata-report .quality-flags code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: .82em;
  background: transparent;
  padding: 0;
}

/* Header placement: chips inline next to dtype, compact size */
#pysuricata-report .var-card__header .title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

#pysuricata-report .var-card__header .title .quality-flags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 0 6px;
  padding: 0;
  list-style: none;
  max-width: 100%;
}

#pysuricata-report .var-card__header .title .quality-flags .flag {
  padding: 0.18rem 0.45rem;
  font-size: .76rem;
  border-radius: 9999px;
}

/* When chips must wrap, keep header tidy */
#pysuricata-report .var-card__header {
  row-gap: 4px;
}

#pysuricata-report .var-card__header .dtype {
  margin-right: 2px;
}

/* Info button for variable cards */
#pysuricata-report .var-card__header {
  position: relative;
}

#pysuricata-report .var-card__header .info-link {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: transparent;
  color: rgba(0, 0, 0, 0.4);
  text-decoration: none;
  transition: all 0.2s ease;
}

#pysuricata-report:not(.light) .var-card__header .info-link {
  color: rgba(255, 255, 255, 0.4);
}

#pysuricata-report .var-card__header .info-link:hover {
  background: rgba(0, 0, 0, 0.05);
  color: rgba(0, 0, 0, 0.7);
  transform: scale(1.1);
}

#pysuricata-report:not(.light) .var-card__header .info-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
}

#pysuricata-report .var-card__header .info-link svg {
  display: block;
  shape-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* === SVG Histogram Styles === */
#pysuricata-report .hist-svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

#pysuricata-report .hist-svg .bar {
  cursor: pointer;
  transition: fill-opacity 0.2s ease, stroke-width 0.2s ease;
}

#pysuricata-report .hist-svg .bar:hover {
  fill-opacity: 0.9;
  stroke-width: 1.5;
}

#pysuricata-report .hist-svg .tick-label {
  user-select: none;
  pointer-events: none;
}

#pysuricata-report .hist-svg .hist-title {
  font-weight: 600;
  fill: currentColor;
}

#pysuricata-report .hist-svg .hist-empty {
  font-style: italic;
  opacity: 0.7;
}

/* Dark mode adjustments for SVG histograms */
#pysuricata-report:not(.light) .hist-svg .tick-label {
  fill: #ccc;
}

#pysuricata-report:not(.light) .hist-svg .hist-title {
  fill: #f9f9f9;
}

#pysuricata-report:not(.light) .hist-svg .hist-empty {
  fill: #999;
}

/* Ensure SVG histograms work with existing tooltip system */
#pysuricata-report .hist-svg .bar[data-count] {
  /* This ensures the existing tooltip JavaScript can find these elements */
}

/*# =====================================================
#   Unify sizes for header chips, Numeric badge, and dtype chip
#   ===================================================== */
#pysuricata-report .var-card__header .badge,
#pysuricata-report .var-card__header .dtype,
#pysuricata-report .var-card__header .title .quality-flags .flag {
  display: inline-flex;
  /* same vertical alignment */
  align-items: center;
  font-size: 0.82rem;
  /* unified text size */
  line-height: 1;
  padding: 0.24rem 0.60rem;
  /* unified padding */
  border-radius: 10px;
  /* unified shape */
}

/* Keep spacing tidy when wrapping */

/* =====================================================
   Compact header chips — smaller size so column name is more visible
   ===================================================== */
#pysuricata-report .var-card__header .badge,
#pysuricata-report .var-card__header .dtype,
#pysuricata-report .var-card__header .title .quality-flags .flag {
  font-size: 0.74rem;
  /* was ~0.82rem */
  padding: 0.14rem 0.42rem;
  /* was 0.24rem 0.60rem */
  border-radius: 6px;
  /* slightly tighter corners */
}

/* Reduce spacing between items so the header stays compact */
#pysuricata-report .var-card__header .title {
  gap: 6px;
}

#pysuricata-report .var-card__header .title .quality-flags {
  gap: 4px;
  margin-left: 4px;
}


/* layout is defined later in the file */

/* === SVG Histogram Styles === */
#pysuricata-report .hist-svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

#pysuricata-report .hist-svg .bar {
  cursor: pointer;
  transition: fill-opacity 0.2s ease, stroke-width 0.2s ease;
}

#pysuricata-report .hist-svg .bar:hover {
  fill-opacity: 0.9;
  stroke-width: 1.5;
}

#pysuricata-report .hist-svg .tick-label {
  user-select: none;
  pointer-events: none;
}

#pysuricata-report .hist-svg .hist-title {
  font-weight: 600;
  fill: currentColor;
}

#pysuricata-report .hist-svg .hist-empty {
  font-style: italic;
  opacity: 0.7;
}

/* Dark mode adjustments for SVG histograms */
#pysuricata-report:not(.light) .hist-svg .tick-label {
  fill: #ccc;
}

#pysuricata-report:not(.light) .hist-svg .hist-title {
  fill: #f9f9f9;
}

#pysuricata-report:not(.light) .hist-svg .hist-empty {
  fill: #999;
}

/* Ensure SVG histograms work with existing tooltip system */
#pysuricata-report .hist-svg .bar[data-count] {
  /* This ensures the existing tooltip JavaScript can find these elements */
}

/*# =============================
#   COMPACT MODE: header height & vertical rhythm
# ============================= */
/* Make header shorter without touching other containers */
#pysuricata-report .appbar .container {
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
}

#pysuricata-report .header-grid {
  row-gap: 0.2rem;
  grid-template-columns: 78px 1fr;
}

#pysuricata-report .header-grid .logo img {
  height: 54px;
}

#pysuricata-report .title-nav h1 {
  font-size: 1.4rem;
}

#pysuricata-report .nav-and-toggle {
  gap: 0.5rem;
}

#pysuricata-report .quick a {
  padding: 0.25rem 0.6rem;
}

#pysuricata-report .meta {
  gap: 0.4rem;
}

/* Reduce space between rows/sections a bit */


/* --- Revert: use emoji-based dark/light icon (colored) --- */
#pysuricata-report #toggle-icon {
  font-size: 1.2rem;
  /* visible emoji size */
  width: auto;
  height: auto;
  line-height: 1;
}

#pysuricata-report #toggle-icon::before,
#pysuricata-report #toggle-icon::after {
  content: "";
  display: none !important;
}

/*# --- Anchor offset so sections don't hide under the sticky header --- */
#pysuricata-report #summary,
#pysuricata-report #sample,
#pysuricata-report #vars {
  scroll-margin-top: var(--anchor-offset);
}

@media (max-width: 560px) {
  #pysuricata-report {
    --anchor-offset: 72px;
  }
}

/* === Numeric card triple layout: two tables + histogram in one row === */
#pysuricata-report .var-card__body .triple-row {
  display: grid;
  grid-template-columns: var(--triple-left) var(--triple-right) 1fr;
  /* left stats, right stats, histogram */
  gap: 12px;
  align-items: end;
  /* Align bottoms: table bottom rows align with histogram x-axis tick labels */
}

#pysuricata-report .var-card__body .triple-row .box {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

/* Make the histogram column stretch and the SVG fill it */
#pysuricata-report .var-card__body .triple-row .chart {
  display: flex;
  flex-direction: column;
}

#pysuricata-report .var-card__body .triple-row .chart .hist-variants {
  flex: 1 1 auto;
  /* fills the available height so the SVG can match tables */
}

#pysuricata-report .var-card__body .triple-row .chart .hist-variants {
  min-height: 260px;
}

#pysuricata-report .var-card__body .triple-row .chart .hist-variants .hist.variant {
  height: 100%;
}

#pysuricata-report .var-card__body .triple-row .chart .hist-variants .hist.variant>svg {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Hide all variants by default; show only the one marked active */
#pysuricata-report .hist-variants .variant {
  display: none;
}

#pysuricata-report .hist-variants .variant.active {
  display: block;
}

#pysuricata-report .var-card__body .triple-row .chart .hist-svg {
  display: block;
  width: 100% !important;
  height: 100% !important;
  /* fills the column height */
}

#pysuricata-report .var-card__body .triple-row .chart .hist-controls {
  margin-top: 6px;
}

#pysuricata-report .var-card__body .triple-row .chart .hist-status {
  margin-top: 2px;
  font-size: .85rem;
  opacity: .85;
}

#pysuricata-report .var-card__body .triple-row .chart .hist-svg {
  display: block;
  width: 100% !important;
  height: 100% !important;
  /* fills the column height */
}

#pysuricata-report .var-card__body .triple-row .chart .hist-controls {
  margin-top: 6px;
}

#pysuricata-report .var-card__body .triple-row .chart .hist-status {
  margin-top: 2px;
  font-size: .85rem;
  opacity: .85;
}

/* Make the histogram fill the same height as the tables */
#pysuricata-report .var-card__body .triple-row {
  align-items: end;
  /* Align bottoms: ensure consistent alignment across all three columns */
}

#pysuricata-report .var-card__body .triple-row .chart {
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  align-self: stretch;
  min-height: 0;
  padding-bottom: 0;
  /* Remove extra padding to let histogram's margin_bottom (40px) control spacing */
}

#pysuricata-report .var-card__body .triple-row .chart .hist-variants {
  flex: 1 1 auto;
  min-height: 200px;
}

/* Override any generic SVG sizing (e.g., .viz svg { height:80px }) so the hist grows */
#pysuricata-report .var-card__body .triple-row .chart .hist-variants svg {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Stack on narrow screens */
@media (max-width: 720px) {
  #pysuricata-report .var-card__body .triple-row .chart .hist-variants {
    min-height: 220px;
  }
}

@media (max-width: 980px) {
  #pysuricata-report .var-card__body .triple-row {
    grid-template-columns: 1fr;
  }
}



/* === Formatting: stats tables (left/right) inside triple layout === */
#pysuricata-report .var-card__body .triple-row .stats-left table,
#pysuricata-report .var-card__body .triple-row .stats-right table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
  font-size: .92rem;
  /* slightly smaller, modern */
  line-height: 1.35;
}

/* Ensure tables have bottom margin to align with histogram tick labels */
#pysuricata-report .var-card__body .triple-row .stats-left,
#pysuricata-report .var-card__body .triple-row .stats-right {
  padding-bottom: 0;
  margin-bottom: 20px;
  /* Aligns bottom row with x-axis tick labels (~20px below x-axis line) */
}

#pysuricata-report .var-card__body .triple-row .stats-left th,
#pysuricata-report .var-card__body .triple-row .stats-left td,
#pysuricata-report .var-card__body .triple-row .stats-right th,
#pysuricata-report .var-card__body .triple-row .stats-right td {
  padding: 6px 8px;
  /* slightly tighter */
  border: 0;
  vertical-align: middle;
}

#pysuricata-report .var-card__body .triple-row .stats-left thead th,
#pysuricata-report .var-card__body .triple-row .stats-right thead th {
  background: transparent;
  /* modern, flat header */
  color: inherit;
  border: 0;
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: .01em;
  text-transform: none;
}

/* modern header–body divider */
#pysuricata-report .var-card__body .triple-row .stats-left thead tr,
#pysuricata-report .var-card__body .triple-row .stats-right thead tr {
  border-bottom: 1px solid var(--border-color);
}

#pysuricata-report .var-card__body .triple-row .stats-left tbody tr:nth-child(even),
#pysuricata-report .var-card__body .triple-row .stats-right tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.015);
}

#pysuricata-report:not(.light) .var-card__body .triple-row .stats-left tbody tr:nth-child(even),
#pysuricata-report:not(.light) .var-card__body .triple-row .stats-right tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

#pysuricata-report .var-card__body .triple-row .stats-left th[scope="row"],
#pysuricata-report .var-card__body .triple-row .stats-right th[scope="row"] {
  background: transparent;
  font-weight: 600;
}

/* Row separators only (no cell borders) */
#pysuricata-report .var-card__body .triple-row .stats-left tbody tr+tr>th,
#pysuricata-report .var-card__body .triple-row .stats-left tbody tr+tr>td,
#pysuricata-report .var-card__body .triple-row .stats-right tbody tr+tr>th,
#pysuricata-report .var-card__body .triple-row .stats-right tbody tr+tr>td {
  border-top: 1px solid var(--divider);
}

/* Subtle hover for modern feel */
#pysuricata-report .var-card__body .triple-row .stats-left tbody tr:hover,
#pysuricata-report .var-card__body .triple-row .stats-right tbody tr:hover {
  background: rgba(0, 0, 0, 0.04);
}

#pysuricata-report:not(.light) .var-card__body .triple-row .stats-left tbody tr:hover,
#pysuricata-report:not(.light) .var-card__body .triple-row .stats-right tbody tr:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Clean, modern alignment */
#pysuricata-report .var-card__body .triple-row .stats-left tbody td:first-child,
#pysuricata-report .var-card__body .triple-row .stats-right tbody td:first-child {
  color: var(--axis-text);
}

#pysuricata-report .var-card__body .triple-row .stats-left tbody td:last-child,
#pysuricata-report .var-card__body .triple-row .stats-right tbody td:last-child {
  text-align: right;
  font-weight: normal;
}

/* Make left column labels bold in general var analysis tables */
#pysuricata-report .var-card__body .triple-row .stats-left tbody th,
#pysuricata-report .var-card__body .triple-row .stats-right tbody th {
  font-weight: 600;
}

/* === Formatting: histogram SVG & axes inside cards === */
#pysuricata-report .hist-svg .axis,
#pysuricata-report .hist-svg .tick {
  stroke: var(--axis);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

#pysuricata-report .hist-svg .grid {
  stroke: var(--axis);
  stroke-opacity: .25;
  stroke-dasharray: 2 2;
  shape-rendering: crispEdges;
}

#pysuricata-report .hist-svg .tick-label {
  font-size: 11px;
  fill: var(--axis-text);
}

#pysuricata-report .hist-svg .tick.minor {
  stroke-opacity: .6;
}

#pysuricata-report .hist-svg text {
  font-family: inherit;
}

#pysuricata-report .hist-svg .bar {
  fill: var(--bar);
  opacity: .9;
  pointer-events: auto;
  border-radius: 6px 6px 0 0;
}

#pysuricata-report .hist-svg .axis-title {
  font-size: 10px;
  fill: var(--axis-text);
}

#pysuricata-report .hist-svg .axis-title.y {
  dominant-baseline: middle;
}

/* Modern, centered bin buttons under the histogram */
#pysuricata-report .hist-controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  /* left (Details) | center (controls) | right spacer */
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

#pysuricata-report .hist-controls .scale-group,
#pysuricata-report .hist-controls .bin-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#pysuricata-report .hist-controls .details {
  grid-column: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
}

#pysuricata-report .hist-controls .center-controls {
  grid-column: 2;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* === Histogram hover tooltip === */
#pysuricata-report {
  position: relative;
}

/* anchor for absolute tooltip */
#pysuricata-report .hist-tooltip {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
  display: none;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(20, 20, 20, 0.92);
  color: #fff;
  font-size: .85rem;
  line-height: 1.25;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

#pysuricata-report.light .hist-tooltip {
  background: rgba(255, 255, 255, 0.96);
  color: #111;
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

#pysuricata-report .hist-tooltip .muted {
  opacity: .75;
  font-weight: 400;
}

#pysuricata-report .hist-tooltip strong {
  font-weight: 700;
}

/* === Quality Flag Tooltips === */
#pysuricata-report .quality-tooltip {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
  display: none;
  padding: 10px 12px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.92);
  color: #f9f9f9;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.8rem;
  line-height: 1.3;
  max-width: 260px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
}

#pysuricata-report.light .quality-tooltip {
  background: rgba(255, 255, 255, 0.96);
  color: #111;
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

/* Tooltip header */
#pysuricata-report .quality-tooltip .tooltip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

#pysuricata-report.light .quality-tooltip .tooltip-header {
  border-bottom-color: rgba(0, 0, 0, 0.12);
}

#pysuricata-report .quality-tooltip .tooltip-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: inherit;
}

#pysuricata-report .quality-tooltip .tooltip-severity {
  font-size: 0.7rem;
  padding: 2px 5px;
  border-radius: 3px;
  font-weight: 500;
  text-transform: uppercase;
}

#pysuricata-report .quality-tooltip .tooltip-severity.good {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

#pysuricata-report .quality-tooltip .tooltip-severity.warn {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

#pysuricata-report .quality-tooltip .tooltip-severity.bad {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

#pysuricata-report .quality-tooltip .tooltip-severity.info {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

/* Tooltip content */
#pysuricata-report .quality-tooltip .tooltip-description {
  margin-bottom: 4px;
  color: inherit;
  opacity: 0.9;
}

#pysuricata-report .quality-tooltip .tooltip-category {
  font-size: 0.7rem;
  opacity: 0.7;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

#pysuricata-report.light .quality-tooltip .tooltip-category {
  border-top-color: rgba(0, 0, 0, 0.08);
}

/* Tooltip threshold section */
#pysuricata-report .quality-tooltip .tooltip-threshold {
  font-size: 0.8rem;
  padding: 6px 8px;
  margin: 6px -2px;
  background: rgba(59, 130, 246, 0.08);
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Monaco, Consolas, monospace;
  border-left: 3px solid rgba(59, 130, 246, 0.4);
  color: inherit;
}

#pysuricata-report.light .quality-tooltip .tooltip-threshold {
  background: rgba(59, 130, 246, 0.06);
  border-left-color: rgba(59, 130, 246, 0.5);
}

#pysuricata-report .quality-tooltip .tooltip-threshold .threshold-label,
#pysuricata-report .quality-tooltip .tooltip-threshold .value-label {
  font-size: 0.75rem;
  opacity: 0.75;
  font-weight: normal;
}

#pysuricata-report .quality-tooltip .tooltip-threshold strong {
  color: #3b82f6;
  font-weight: 600;
  margin: 0 4px;
}

#pysuricata-report.light .quality-tooltip .tooltip-threshold strong {
  color: #2563eb;
}

#pysuricata-report .quality-tooltip .tooltip-threshold .threshold-separator {
  opacity: 0.4;
  margin: 0 6px;
}

/* Screen reader only content */
#pysuricata-report .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}



/* === SVG Histogram Styles === */
#pysuricata-report .hist-svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

#pysuricata-report .hist-svg .bar {
  cursor: pointer;
  transition: fill-opacity 0.2s ease, stroke-width 0.2s ease;
}

#pysuricata-report .hist-svg .bar:hover {
  fill-opacity: 0.9;
  stroke-width: 1.5;
}

#pysuricata-report .hist-svg .tick-label {
  user-select: none;
  pointer-events: none;
}

#pysuricata-report .hist-svg .hist-title {
  font-weight: 600;
  fill: currentColor;
}

#pysuricata-report .hist-svg .hist-empty {
  font-style: italic;
  opacity: 0.7;
}

/* Dark mode adjustments for SVG histograms */
#pysuricata-report:not(.light) .hist-svg .tick-label {
  fill: #ccc;
}

#pysuricata-report:not(.light) .hist-svg .hist-title {
  fill: #f9f9f9;
}

#pysuricata-report:not(.light) .hist-svg .hist-empty {
  fill: #999;
}

/* Ensure SVG histograms work with existing tooltip system */
#pysuricata-report .hist-svg .bar[data-count] {
  /* This ensures the existing tooltip JavaScript can find these elements */
}

/*# =============================
#    DETAILS BUTTON + FULL-WIDTH SECTION (pestañas)
# =============================
/* Make Details look like our pills and keep it steady (no movement on hover) */
#pysuricata-report .details-toggle {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 9999px;
  border: 1px solid rgba(59, 130, 246, .45);
  background: rgba(59, 130, 246, .12);
  color: #1e40af;
  cursor: pointer;
  font: inherit;
  font-size: .82rem;
  line-height: 1;
  box-shadow: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

#pysuricata-report:not(.light) .details-toggle {
  border-color: rgba(147, 197, 253, .55);
  background: rgba(147, 197, 253, .18);
  color: #bfdbfe;
}

#pysuricata-report .details-toggle:hover {
  filter: none;
  background: rgba(59, 130, 246, .18);
}

#pysuricata-report .details-toggle:focus-visible {
  outline: 2px solid #4ea3f1;
  outline-offset: 2px;
}

/* Optional caret that flips when open */
#pysuricata-report .details-toggle::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
  transition: transform .2s ease;
}

#pysuricata-report .details-toggle[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

/* Full-width details section placed below the triple row */
#pysuricata-report .details-section {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid var(--chip-br-light);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.02);
}

#pysuricata-report:not(.light) .details-section {
  background: rgba(255, 255, 255, 0.04);
}

/* Tabs (pestañas) styling */
#pysuricata-report .details-section .tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

#pysuricata-report .details-section .tabs [role="tab"] {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--chip-br-light);
  background: var(--chip-bg-light);
  color: inherit;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 9999px;
  font: inherit;
  font-size: .8rem;
  line-height: 1;
}

#pysuricata-report:not(.light) .details-section .tabs [role="tab"] {
  border-color: var(--chip-br-dark);
  background: var(--chip-bg-dark);
}

#pysuricata-report .details-section .tabs [role="tab"].active {
  background: rgba(59, 130, 246, 0.12);
  border-color: var(--accent-color);
  border-bottom: 2px solid var(--accent-color);
  color: #1e40af;
  font-weight: 600;
}

#pysuricata-report:not(.light) .details-section .tabs [role="tab"].active {
  background: rgba(96, 165, 250, 0.2);
  border-color: var(--accent-color);
  border-bottom: 2px solid var(--accent-color);
  color: #93c5fd;
  font-weight: 600;
}

/* Tab panes visibility */
#pysuricata-report .details-section .tab-panes .tab-pane {
  display: none;
}

#pysuricata-report .details-section .tab-panes .tab-pane.active {
  display: block;
}

/* Statistics + Quantiles side-by-side */
#pysuricata-report .details-section .stats-quant {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 720px) {
  #pysuricata-report .details-section .stats-quant {
    grid-template-columns: 1fr;
  }
}

/* =============================
   MATCH TABLE STYLING (like left/right stats tables)
   ============================= */
#pysuricata-report .details-section table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
  font-size: .92rem;
  line-height: 1.35;
}

#pysuricata-report .details-section thead th {
  background: transparent;
  color: inherit;
  border: 0;
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: .01em;
}

#pysuricata-report .details-section thead tr {
  border-bottom: 1px solid var(--border-color);
}

#pysuricata-report .details-section tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.015);
}

#pysuricata-report:not(.light) .details-section tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

#pysuricata-report .details-section tbody tr:hover {
  background: rgba(0, 0, 0, 0.04);
}

#pysuricata-report:not(.light) .details-section tbody tr:hover {
  background: rgba(255, 255, 255, 0.06);
}

#pysuricata-report .details-section tbody th[scope="row"] {
  background: transparent;
  font-weight: 600;
}

#pysuricata-report .details-section tbody tr+tr>th,
#pysuricata-report .details-section tbody tr+tr>td {
  border-top: 1px solid var(--divider);
}

#pysuricata-report .details-section tbody td:first-child {
  color: var(--axis-text);
}

#pysuricata-report .details-section tbody td:last-child {
  text-align: right;
  font-weight: normal;
}

/* Ensure left column labels in details tables are bold */
#pysuricata-report .details-section tbody th {
  font-weight: 600;
}

/* =============================
   HIST CONTROL BUTTONS (Linear/Log/Bins) unified look
   ============================= */
/* Base pill reset for control buttons (flatter look) */
#pysuricata-report .hist-controls button {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 9999px;
  font: inherit;
  font-size: .82rem;
  line-height: 1;
  border: 1px solid transparent;
  background: rgba(0, 0, 0, 0.04);
  color: inherit;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

/* SCALE group — blue */
#pysuricata-report .hist-controls .scale-group button {
  background: rgba(59, 130, 246, .10);
  border-color: rgba(59, 130, 246, .25);
  color: #1e40af;
  /* blue-900 */
}

#pysuricata-report:not(.light) .hist-controls .scale-group button {
  background: rgba(59, 130, 246, .18);
  border-color: rgba(59, 130, 246, .30);
  color: #bfdbfe;
  /* blue-200 */
}

#pysuricata-report:not(.light) .hist-controls .scale-group button.active {
  background: rgba(59, 130, 246, .35);
  border-color: rgba(59, 130, 246, .50);
  color: #dbeafe;
  /* blue-100 */
  font-weight: 600;
}

#pysuricata-report .hist-controls .scale-group button.active {
  background: rgba(59, 130, 246, .28);
  border-color: rgba(59, 130, 246, .45);
  color: #1e3a8a;
  /* blue-800 */
  font-weight: 600;
}

/* BINS group — blue (slightly lighter to distinguish) */
#pysuricata-report .hist-controls .bin-group button {
  background: rgba(96, 165, 250, .10);
  border-color: rgba(96, 165, 250, .22);
  color: #1d4ed8;
  /* blue-700 */
}

#pysuricata-report:not(.light) .hist-controls .bin-group button {
  background: rgba(96, 165, 250, .18);
  border-color: rgba(96, 165, 250, .30);
  color: #dbeafe;
  /* blue-100 */
}

#pysuricata-report:not(.light) .hist-controls .bin-group button.active {
  background: rgba(96, 165, 250, .35);
  border-color: rgba(96, 165, 250, .50);
  color: #dbeafe;
  /* blue-100 */
  font-weight: 600;
}

#pysuricata-report .hist-controls .bin-group button.active {
  background: rgba(96, 165, 250, .26);
  border-color: rgba(96, 165, 250, .42);
  color: #1e3a8a;
  /* blue-800 */
  font-weight: 600;
}

/* Hover effects (very light) */
#pysuricata-report .hist-controls .scale-group button:hover {
  background: rgba(59, 130, 246, .20);
}

#pysuricata-report .hist-controls .bin-group button:hover {
  background: rgba(96, 165, 250, .22);
}

/* Align Details button row with the triple layout */
#pysuricata-report .card-controls {
  display: grid;
  grid-template-columns: var(--triple-left) var(--triple-right) 1fr;
  /* match .triple-row */
  gap: 12px;
  align-items: center;
  margin-top: 0px;
}

#pysuricata-report .card-controls .details-slot {
  grid-column: 1;
  justify-self: start;
}

#pysuricata-report .card-controls .controls-slot {
  grid-column: 3;
  justify-self: center;
}

#pysuricata-report .card-controls .details-slot,
#pysuricata-report .card-controls .controls-slot {
  align-self: center;
}

/* In the controls row, the hist-controls wrapper only contains the center group; make it inline-flex and remove any top margin inherited from chart placement */
#pysuricata-report .card-controls .hist-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 0;
}

#pysuricata-report .card-controls .hist-controls .center-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* === SVG Histogram Styles === */
#pysuricata-report .hist-svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

#pysuricata-report .hist-svg .bar {
  cursor: pointer;
  transition: fill-opacity 0.2s ease, stroke-width 0.2s ease;
}

#pysuricata-report .hist-svg .bar:hover {
  fill-opacity: 0.9;
  stroke-width: 1.5;
}

#pysuricata-report .hist-svg .tick-label {
  user-select: none;
  pointer-events: none;
}

#pysuricata-report .hist-svg .hist-title {
  font-weight: 600;
  fill: currentColor;
}

#pysuricata-report .hist-svg .hist-empty {
  font-style: italic;
  opacity: 0.7;
}

/* Dark mode adjustments for SVG histograms */
#pysuricata-report:not(.light) .hist-svg .tick-label {
  fill: #ccc;
}

#pysuricata-report:not(.light) .hist-svg .hist-title {
  fill: #f9f9f9;
}

#pysuricata-report:not(.light) .hist-svg .hist-empty {
  fill: #999;
}

/* Ensure SVG histograms work with existing tooltip system */
#pysuricata-report .hist-svg .bar[data-count] {
  /* This ensures the existing tooltip JavaScript can find these elements */
}

/*# =============================================
#   Categorical mini‑bars (Top‑N) – sizing + typography
#   ============================================= */
/* Make categorical variants fill the chart column just like histograms */
#pysuricata-report .var-card__body .triple-row .chart .hist-variants .cat.variant {
  height: 100%;
}

#pysuricata-report .var-card__body .triple-row .chart .hist-variants .cat.variant>svg {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Cat SVG styling (bars + labels) */
#pysuricata-report .cat-svg text {
  font-family: inherit;
}

#pysuricata-report .cat-svg .bar {
  fill: var(--bar);
  opacity: .9;
}

#pysuricata-report .cat-svg .bar-label {
  font-size: 11px;
  fill: var(--axis-text);
}

#pysuricata-report .cat-svg .bar-value {
  font-size: 11px;
  fill: var(--axis-text);
}

/* Optional: keep long label/value text from poking outside on very narrow cards */
@media (max-width: 680px) {
  #pysuricata-report .cat-svg .bar-value {
    display: none;
  }
}

/*# Responsive tweak for controls row stacking on narrow screens*/
@media (max-width: 980px) {
  #pysuricata-report .card-controls {
    grid-template-columns: 1fr;
  }

  #pysuricata-report .card-controls .controls-slot {
    grid-column: 1;
    justify-self: start;
    margin-top: 6px;
  }
}

/* =============================
   DATETIME VARIABLES – triple layout & mini‑charts
   ============================= */
#pysuricata-report .var-card__body .triple-row .chart .dt-chart {
  display: block;
  width: 100%;
  min-height: 90px;
}

#pysuricata-report .var-card__body .triple-row .chart .dt-chart:first-child {
  min-height: 220px;
  /* main timeline area */
  flex: 1 1 auto;
  /* allow to stretch like histogram */
}

#pysuricata-report .var-card__body .triple-row .chart .dt-chart:not(:first-child) {
  margin-top: 8px;
  /* space between small multiples */
}

/* SVG baseline for datetime charts (mirrors .hist-svg styling) */
#pysuricata-report .dt-svg {
  display: block;
  max-width: 100%;
}

#pysuricata-report .dt-svg text {
  font-family: inherit;
}

#pysuricata-report .dt-svg .axis,
#pysuricata-report .dt-svg .tick {
  stroke: var(--axis);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

#pysuricata-report .dt-svg .grid {
  stroke: var(--axis);
  stroke-opacity: .25;
  stroke-dasharray: 2 2;
  shape-rendering: crispEdges;
}

#pysuricata-report .dt-svg .tick-label {
  font-size: 11px;
  fill: var(--axis-text);
}

#pysuricata-report .dt-svg .bar {
  fill: var(--bar);
  opacity: .9;
}


/* Compact captions for small multiples */
#pysuricata-report .dt-caption {
  font-size: .8rem;
  opacity: .85;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Responsive: keep datetime charts tidy on narrow screens */
@media (max-width: 720px) {
  #pysuricata-report .var-card__body .triple-row .chart .dt-chart:first-child {
    min-height: 200px;
  }

  #pysuricata-report .var-card__body .triple-row .chart .dt-chart {
    min-height: 80px;
  }
}

/* =============================
   Datetime SVG: axis titles & responsive ticks
   ============================= */
#pysuricata-report .dt-svg .axis-title {
  font-size: 10px;
  fill: var(--axis-text);
}

#pysuricata-report .dt-svg .axis-title.y {
  dominant-baseline: middle;
}

#pysuricata-report .dt-svg .axis-title.x {
  dominant-baseline: hanging;
}

/* Keep tick labels readable on small screens */
@media (max-width: 560px) {
  #pysuricata-report .dt-svg .tick-label {
    font-size: 10px;
  }
}

/* =============================
   Suggestions list (used in Datetime details)
   ============================= */
#pysuricata-report .suggestions {
  list-style: none;
  margin: 0;
  padding-left: 0;
  display: grid;
  row-gap: 6px;
}

#pysuricata-report .suggestions li {
  position: relative;
  padding-left: 22px;
  line-height: 1.35;
}

#pysuricata-report .suggestions li::before {
  content: '💡';
  position: absolute;
  left: 0;
  top: 0.1rem;
  opacity: .9;
}

#pysuricata-report:not(.light) .suggestions li::before {
  opacity: 1;
}

/* =============================
   Datetime card polish — fix wrapping, clipping and layout
   ============================= */
/* Prevent label/value wrapping inside the small key/value tables. Keep single line with ellipsis. */
#pysuricata-report .var-card__body .triple-row .stats-left table.kv,
#pysuricata-report .var-card__body .triple-row .stats-right table.kv {
  table-layout: fixed;
  /* two columns => stable widths */
}

#pysuricata-report .var-card__body .triple-row .stats-left table.kv th,
#pysuricata-report .var-card__body .triple-row .stats-left table.kv td,
#pysuricata-report .var-card__body .triple-row .stats-right table.kv th,
#pysuricata-report .var-card__body .triple-row .stats-right table.kv td {
  white-space: nowrap;
}

#pysuricata-report .var-card__body .triple-row .stats-left table.kv td,
#pysuricata-report .var-card__body .triple-row .stats-right table.kv td {
  overflow: hidden;
  text-overflow: ellipsis;
  /* one-line with … */
}

/* Make header cells obey the box and prefer truncation over wrapping */
#pysuricata-report .var-card__body .triple-row .stats-left table.kv th,
#pysuricata-report .var-card__body .triple-row .stats-right table.kv th {
  overflow: visible;
  text-overflow: clip;
  /* Allow labels to display fully without truncation */
}

/* Ensure the outer SVG does not clip tick labels at the right/bottom edges */
#pysuricata-report .dt-svg {
  overflow: visible;
}

/* Slightly widen right stats column on larger screens to reduce ellipsis of ISO timestamps */
@media (min-width: 980px) {
  #pysuricata-report {
    --triple-right: 280px;
  }
}

/* =============================
   Summary → Top missing columns: fixed vertical height (5 rows)
   ============================= */
#pysuricata-report .top-missing-card .bars,
#pysuricata-report #top-missing .bars,
#pysuricata-report .missing-list,
#pysuricata-report .meter-list {
  --tm-row-h: 28px;
  /* row height */
  --tm-row-gap: 8px;
  /* space between rows */
  display: grid;
  grid-auto-rows: var(--tm-row-h);
  row-gap: var(--tm-row-gap);
  align-content: start;
  /* stick rows to top; keep reserved space below */
  min-height: calc(5 * var(--tm-row-h) + 4 * var(--tm-row-gap));
}

/* Align each row's label | bar | percentage on one line */
#pysuricata-report .missing-list .row,
#pysuricata-report .meter-list .row,
#pysuricata-report .top-missing-card .bars .row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  /* label | bar | pct */
  column-gap: 10px;
  align-items: center;
  min-height: var(--tm-row-h);
}

/* === SVG Histogram Styles === */
#pysuricata-report .hist-svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

#pysuricata-report .hist-svg .bar {
  cursor: pointer;
  transition: fill-opacity 0.2s ease, stroke-width 0.2s ease;
}

#pysuricata-report .hist-svg .bar:hover {
  fill-opacity: 0.9;
  stroke-width: 1.5;
}

#pysuricata-report .hist-svg .tick-label {
  user-select: none;
  pointer-events: none;
}

#pysuricata-report .hist-svg .hist-title {
  font-weight: 600;
  fill: currentColor;
}

#pysuricata-report .hist-svg .hist-empty {
  font-style: italic;
  opacity: 0.7;
}

/* Dark mode adjustments for SVG histograms */
#pysuricata-report:not(.light) .hist-svg .tick-label {
  fill: #ccc;
}

#pysuricata-report:not(.light) .hist-svg .hist-title {
  fill: #f9f9f9;
}

#pysuricata-report:not(.light) .hist-svg .hist-empty {
  fill: #999;
}

/* Ensure SVG histograms work with existing tooltip system */
#pysuricata-report .hist-svg .bar[data-count] {
  /* This ensures the existing tooltip JavaScript can find these elements */
}

/*# =============================
#   DATETIME card – align chart height with tables & trim bottom whitespace
# =============================
/* Triple row alignment is now handled by the general rule above */
#pysuricata-report .var-card__body .triple-row>* {
  align-self: stretch;
}

/* Let the main datetime chart fill its column height without relying on % heights */
#pysuricata-report .var-card__body .triple-row .chart .dt-chart:first-child {
  display: flex;
  /* container controls child sizing */
  flex: 1 1 auto;
  /* stretch to full column height */
  min-height: 0;
  /* allow shrinking if needed */
}

#pysuricata-report .var-card__body .triple-row .chart .dt-chart:first-child>.dt-svg {
  flex: 1 1 auto;
  /* SVG fills the dt-chart block */
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Remove extra bottom padding on datetime cards specifically */
#pysuricata-report .var-card:has(.dt-chart) .var-card__body {
  padding-bottom: 8px;
}

/* Avoid extra vertical space from nested margins under the triple row */
#pysuricata-report .var-card:has(.dt-chart) .var-card__body .triple-row table {
  margin-bottom: 0;
}

#pysuricata-report .var-card:has(.dt-chart) .card-controls {
  margin-top: 4px;
  margin-bottom: 0;
}

/* Ensure the chart column itself has no bottom padding so it aligns with tables (datetime only) */
#pysuricata-report .var-card:has(.dt-chart) .var-card__body .triple-row .chart {
  padding-bottom: 0;
}

/* =============================
   BOOLEAN VARIABLES – stacked bar chart styling
   ============================= */

/* Theme tokens for boolean segments */
#pysuricata-report {
  --bool-true: #10b981;
  /* teal-500 */
  --bool-false: #ef4444;
  /* red-500 */
  --bool-miss: #9ca3af;
  /* gray-400 */
}

#pysuricata-report {
  --bool-true: #10b981;
  /* emerald-500 */
  --bool-false: #ef4444;
  /* red-500 */
  --bool-miss: #9ca3af;
  /* gray-400 */
}

#pysuricata-report:not(.light) {
  --bool-true: #34d399;
  /* teal-400 */
  --bool-false: #f87171;
  /* red-400 */
  --bool-miss: #9ca3af;
  /* gray-400 (kept neutral) */
}

/* Inline stacked bar SVG */
#pysuricata-report .bool-svg {
  width: 100%;
  height: 48px;
  /* matches your compact chart lane */
  display: block;
}

#pysuricata-report .bool-svg .seg {
  shape-rendering: crispEdges;
  opacity: .92;
}

#pysuricata-report .bool-svg .label {
  fill: #fff;
  font-weight: 700;
  font-size: 12px;
  text-anchor: middle;
  dominant-baseline: middle;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, .35);
  stroke-width: 2px;
}

#pysuricata-report .bool-svg .seg.false {
  fill: var(--bool-false);
}

#pysuricata-report .bool-svg .seg.true {
  fill: var(--bool-true);
}

#pysuricata-report .bool-svg .seg.missing {
  fill: var(--bool-miss);
  opacity: .65;
}

/* Rounded ends look better on short charts */
#pysuricata-report .bool-svg .seg {
  rx: 2;
  ry: 2;
}

/* When boolean chart sits in the chart cell, make sure it aligns vertically like others */
#pysuricata-report .var-card__body .triple-row .chart .bool-svg {
  width: 100% !important;
  height: 100% !important;
}

/* Optional: compact labels in boolean tables (inherits your kv table look) */
#pysuricata-report .var-card__body .triple-row .stats-left table.kv,
#pysuricata-report .var-card__body .triple-row .stats-right table.kv {
  table-layout: fixed;
}

#pysuricata-report .var-card__body .triple-row .stats-left table.kv th,
#pysuricata-report .var-card__body .triple-row .stats-left table.kv td,
#pysuricata-report .var-card__body .triple-row .stats-right table.kv th,
#pysuricata-report .var-card__body .triple-row .stats-right table.kv td {
  white-space: nowrap;
}

/* Only apply ellipsis to td (values), not th (labels) */
#pysuricata-report .var-card__body .triple-row .stats-left table.kv td,
#pysuricata-report .var-card__body .triple-row .stats-right table.kv td {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =============================
   NEW SECTION DESIGN STYLES
   ============================= */

/* Stack layout for main content */
#pysuricata-report .stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Section divider line - removed excessive spacing */
#pysuricata-report .section-divider {
  border: none;
  border-top: 1px solid var(--divider);
  margin: 0.05rem 0 0.05rem 0;
  opacity: 0.6;
}

/* Section description text */
#pysuricata-report .section-description {
  font-size: 0.95rem;
  line-height: 1.5;
  color: inherit;
  opacity: 0.8;
  margin: 0 0 1.5rem 0;
  max-width: 800px;
}

/* Logo clickable styling */
#pysuricata-report .logo a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

#pysuricata-report .logo a:hover {
  transform: scale(1.05);
  opacity: 0.8;
}

/* Footer divider */
#pysuricata-report footer.page .section-divider {
  margin: 0 0 1rem 0;
}

/* Sample content adjustments for new layout */
#pysuricata-report .sample-scroll {
  margin-bottom: 1rem;
}

#pysuricata-report .sample-scroll+p {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.7;
}

/* =============================================
   COMMON VALUES TABLE STYLING
   ============================================= */

/* Common Values Table - Professional styling matching report theme */
#pysuricata-report .common-values-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin: 8px 0;
  background: white;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#pysuricata-report:not(.light) .common-values-table {
  background: #2a2a2a;
  color: #e0e0e0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

#pysuricata-report .common-values-table thead th {
  background: rgba(0, 0, 0, 0.05);
  color: inherit;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 8px 12px;
  text-align: left;
  border-bottom: 2px solid var(--chip-br-light);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

#pysuricata-report:not(.light) .common-values-table thead th {
  background: rgba(255, 255, 255, 0.08);
  border-bottom-color: var(--chip-br-dark);
}

#pysuricata-report .common-values-table td {
  padding: 6px 12px;
  border-bottom: 1px solid var(--chip-br-light);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

#pysuricata-report:not(.light) .common-values-table td {
  border-bottom-color: var(--chip-br-dark);
}

#pysuricata-report .common-values-table .common-value {
  text-align: right;
  font-weight: 500;
}

#pysuricata-report .common-values-table .common-count {
  text-align: center;
  color: #666;
}

#pysuricata-report:not(.light) .common-values-table .common-count {
  color: #aaa;
}

#pysuricata-report .common-values-table .common-pct {
  text-align: right;
  font-weight: 500;
  color: #007acc;
}

#pysuricata-report:not(.light) .common-values-table .common-pct {
  color: #4db8ff;
}

#pysuricata-report .common-values-table tbody tr:hover {
  background: rgba(0, 0, 0, 0.02);
}

#pysuricata-report:not(.light) .common-values-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

#pysuricata-report .common-values-table tbody tr:last-child td {
  border-bottom: none;
}

/* =============================================
   HISTOGRAM TICK IMPROVEMENTS
   ============================================= */

/* =============================================
   ENHANCED HISTOGRAM TICK STYLING
   ============================================= */


/* Enhanced major tick visibility */
#pysuricata-report .tick-major {
  stroke: currentColor;
  stroke-width: 1;
  opacity: 0.9;
}

/* Better tick label styling with improved readability */
#pysuricata-report .tick-label {
  font-size: 10px;
  fill: currentColor;
  opacity: 0.9;
  font-weight: 500;
}

/* Specific improvements for log scale ticks */
#pysuricata-report .hist[data-scale="log"] .tick-major {
  stroke-width: 1.2;
  opacity: 1;
}

#pysuricata-report .hist[data-scale="log"] .tick-label {
  font-size: 11px;
  font-weight: normal;
  opacity: 1;
}

/* Ensure axis lines are visible */
#pysuricata-report .axis {
  stroke: currentColor;
  stroke-width: 1.5;
  opacity: 0.8;
}

/* =============================================
   ENHANCED COMMON VALUES TABLE STYLING
   ============================================= */

/* Enhanced Common Values Table - Professional styling matching report theme */
#pysuricata-report .common-values-table.enhanced {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin: 8px 0;
  background: white;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--chip-br-light);
}

#pysuricata-report:not(.light) .common-values-table.enhanced {
  background: #2a2a2a;
  color: #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  border-color: var(--chip-br-dark);
}

#pysuricata-report .common-values-table.enhanced thead th {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.02));
  color: inherit;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 10px 8px;
  text-align: center;
  border-bottom: 2px solid var(--chip-br-light);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#pysuricata-report:not(.light) .common-values-table.enhanced thead th {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border-bottom-color: var(--chip-br-dark);
}

#pysuricata-report .common-values-table.enhanced td {
  padding: 8px;
  border-bottom: 1px solid var(--chip-br-light);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  vertical-align: middle;
  text-align: center;
}

#pysuricata-report:not(.light) .common-values-table.enhanced td {
  border-bottom-color: var(--chip-br-dark);
}

/* Rank column styling */
#pysuricata-report .common-values-table.enhanced .rank {
  text-align: center;
  font-weight: 600;
  width: 40px;
  font-size: 0.82rem;
}

/* Value column styling */
#pysuricata-report .common-values-table.enhanced .common-value {
  text-align: center;
  font-weight: 500;
  min-width: 80px;
}

/* Count column styling */
#pysuricata-report .common-values-table.enhanced .common-count {
  text-align: center;
  color: #666;
  min-width: 60px;
}

#pysuricata-report:not(.light) .common-values-table.enhanced .common-count {
  color: #aaa;
}

/* Percentage column styling */
#pysuricata-report .common-values-table.enhanced .common-pct {
  text-align: center;
  font-weight: 500;
  color: #007acc;
  min-width: 60px;
}

#pysuricata-report:not(.light) .common-values-table.enhanced .common-pct {
  color: #4db8ff;
}

/* Progress bar column */
#pysuricata-report .common-values-table.enhanced .progress-bar {
  width: 100px;
  padding: 4px 8px;
  text-align: center;
}

#pysuricata-report .common-values-table.enhanced .bar-fill {
  height: 6px;
  background: linear-gradient(90deg, #007acc, #4db8ff);
  border-radius: 3px;
  transition: width 0.3s ease;
}

#pysuricata-report:not(.light) .common-values-table.enhanced .bar-fill {
  background: linear-gradient(90deg, #4db8ff, #66c2ff);
}

/* Row hover effects */
#pysuricata-report .common-values-table.enhanced tbody tr:hover {
  background: rgba(0, 0, 0, 0.02);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#pysuricata-report:not(.light) .common-values-table.enhanced tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Top 3 rows special styling */
#pysuricata-report .common-values-table.enhanced
}

#pysuricata-report .common-values-table.enhanced
}

/* Responsive design */
@media (max-width: 768px) {
  #pysuricata-report .common-values-table.enhanced {
    font-size: 0.7rem;
  }

  #pysuricata-report .common-values-table.enhanced .progress-bar {
    width: 60px;
  }
}

/* =============================================
   ENHANCED MIN/MAX SECTIONS STYLING
   ============================================= */

/* Main extremes container */
#pysuricata-report .extremes.stats-quant {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 12px 0;
}

/* Individual min/max subsections */
#pysuricata-report .extremes .sub {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--chip-br-light);
}

#pysuricata-report:not(.light) .extremes .sub {
  background: #2a2a2a;
  color: #e0e0e0;
  border-color: var(--chip-br-dark);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Section headers */
#pysuricata-report .extremes .sub .hdr {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.03));
  color: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 12px 16px;
  border-bottom: 1px solid var(--chip-br-light);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
}

#pysuricata-report:not(.light) .extremes .sub .hdr {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border-bottom-color: var(--chip-br-dark);
}

/* Tables within min/max sections */
#pysuricata-report .extremes .sub table.kv {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: 0.8rem;
}

#pysuricata-report .extremes .sub table.kv thead th {
  background: rgba(0, 0, 0, 0.02);
  font-weight: 600;
  font-size: 0.75rem;
  padding: 8px 12px;
  text-align: center;
  border-bottom: 1px solid var(--chip-br-light);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

#pysuricata-report:not(.light) .extremes .sub table.kv thead th {
  background: rgba(255, 255, 255, 0.04);
  border-bottom-color: var(--chip-br-dark);
}

#pysuricata-report .extremes .sub table.kv tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--chip-br-light);
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

#pysuricata-report:not(.light) .extremes .sub table.kv tbody td {
  border-bottom-color: var(--chip-br-dark);
}

#pysuricata-report .extremes .sub table.kv tbody tr:last-child td {
  border-bottom: none;
}

#pysuricata-report .extremes .sub table.kv tbody tr:hover {
  background: rgba(0, 0, 0, 0.02);
}

#pysuricata-report:not(.light) .extremes .sub table.kv tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* Numeric value styling in min/max tables */
#pysuricata-report .extremes .sub table.kv td.num {
  font-weight: 500;
  /* Use default text color to match index column */
}

/* Outliers table styling */
#pysuricata-report .outliers .sub table.kv td.method {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-style: italic;
}

#pysuricata-report .outliers .sub table.kv td.severity {
  font-size: 0.85rem;
  font-weight: 500;
}

#pysuricata-report .outliers .sub table.kv td.severity[data-severity="extreme"] {
  color: #d73a49;
}

#pysuricata-report .outliers .sub table.kv td.severity[data-severity="high"] {
  color: #f66a0a;
}

#pysuricata-report .outliers .sub table.kv td.severity[data-severity="moderate"] {
  color: #0366d6;
}

/* Enhanced outliers section styling */
#pysuricata-report .outlier-summary {
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 6px;
  border: 1px solid var(--chip-br-light);
}

#pysuricata-report .summary-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-weight: 600;
}

/* Direction icon and label for outlier summaries (scoped to avoid conflicts) */
#pysuricata-report .outlier-summary .direction-icon {
  font-size: 1.2em;
}

#pysuricata-report .outlier-summary .direction-label {
  font-weight: 600;
  font-size: 0.95rem;
}

#pysuricata-report .outlier-count {
  color: var(--text-secondary);
  font-weight: 500;
}

#pysuricata-report .severity-breakdown {
  display: flex;
  gap: 12px;
  font-size: 0.82rem;
  flex-wrap: wrap;
}

#pysuricata-report .method-severity-group {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 4px;
}

#pysuricata-report:not(.light) .method-severity-group {
  background: rgba(255, 255, 255, 0.03);
}

#pysuricata-report .method-label {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#pysuricata-report .severity-item {
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 500;
}

#pysuricata-report .severity-item.extreme {
  background: rgba(215, 58, 73, 0.1);
  color: #d73a49;
}

#pysuricata-report .severity-item.high {
  background: rgba(246, 106, 10, 0.1);
  color: #f66a0a;
}

#pysuricata-report .severity-item.moderate {
  background: rgba(3, 102, 214, 0.1);
  color: #0366d6;
}

/* Context note styling for outliers section */
#pysuricata-report .context-note {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(3, 102, 214, 0.05);
  border-left: 3px solid #0366d6;
  border-radius: 0 4px 4px 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Outlier note styling for index information */
#pysuricata-report .outlier-note {
  margin-top: 12px;
  padding: 8px 12px;
  background: rgba(128, 128, 128, 0.05);
  border-left: 3px solid #888;
  border-radius: 0 4px 4px 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

#pysuricata-report:not(.light) .outlier-note {
  background: rgba(255, 255, 255, 0.03);
  border-left-color: #aaa;
}

#pysuricata-report:not(.light) .context-note {
  background: rgba(3, 102, 214, 0.1);
  color: var(--text-secondary);
}

#pysuricata-report .context-note small {
  display: block;
  margin: 0;
}



/* Enhanced outliers table styling */
#pysuricata-report .outliers-table.enhanced {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
  margin-top: 8px;
}

#pysuricata-report .outliers-table.enhanced thead th {
  background: var(--bg-tertiary);
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 0.82rem;
  border-bottom: 2px solid var(--border-color);
}

#pysuricata-report .outliers-table.enhanced td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
}

#pysuricata-report .outliers-table.enhanced .rank {
  text-align: center;
  font-weight: 600;
  width: 40px;
}

#pysuricata-report .outliers-table.enhanced .outlier-value {
  font-weight: 500;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

#pysuricata-report .outliers-table.enhanced tbody tr:hover {
  background: var(--bg-hover);
}

/* Sub-row styling for multi-method outliers */
#pysuricata-report .outliers-table.enhanced .outlier-row-sub {
  border-top: none;
}

#pysuricata-report .outliers-table.enhanced .outlier-row-sub td {
  border-top: 1px dashed var(--border-color);
  padding-top: 6px;
  padding-bottom: 6px;
}

#pysuricata-report:not(.light) .outliers-table.enhanced thead th {
  background: var(--bg-tertiary);
  border-bottom-color: var(--border-color);
}

#pysuricata-report:not(.light) .outliers-table.enhanced tbody tr:hover {
  background: var(--bg-hover);
}

/* Empty state styling */
#pysuricata-report .extremes .sub .muted {
  padding: 20px;
  text-align: center;
  color: #888;
  font-style: italic;
}

#pysuricata-report:not(.light) .extremes .sub .muted {
  color: #aaa;
}

/* Responsive design for min/max sections */
@media (max-width: 768px) {
  #pysuricata-report .extremes.stats-quant {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  #pysuricata-report .extremes .sub table.kv {
    font-size: 0.75rem;
  }

  #pysuricata-report .extremes .sub .hdr {
    font-size: 0.8rem;
    padding: 10px 12px;
  }
}

/* ============================================================================
   CORRELATIONS SECTION - Complete Redesign
   Fixed vertical alignment issues with proper table cell centering
   ============================================================================ */

/* Correlation Summary Header */
#pysuricata-report .correlation-summary {
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 6px;
  border: 1px solid var(--chip-br-light);
}

#pysuricata-report .correlation-summary .summary-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-weight: 600;
}

#pysuricata-report .correlation-summary .icon {
  font-size: 1.2em;
}

#pysuricata-report .correlation-summary .count {
  color: var(--text-secondary);
  font-weight: 500;
}

/* Strength Breakdown Badges */
#pysuricata-report .strength-breakdown {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

#pysuricata-report .strength-item {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
}

#pysuricata-report .strength-item.very-strong {
  background: rgba(220, 38, 127, 0.1);
  color: #dc267f;
}

#pysuricata-report .strength-item.strong {
  background: rgba(234, 88, 12, 0.1);
  color: #ea580c;
}

#pysuricata-report .strength-item.moderate {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

#pysuricata-report .strength-item.weak {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

/* ============================================================================
   CORRELATIONS TABLE - Redesigned with Fixed Vertical Alignment
   ============================================================================ */

/* Table Foundation - Fixed Layout with Visual Polish */
#pysuricata-report .correlations-table.enhanced {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
  margin: 8px 0;

  /* Visual polish matching common values table */
  background: white;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--chip-br-light);
}

#pysuricata-report:not(.light) .correlations-table.enhanced {
  background: #2a2a2a;
  color: #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  border-color: var(--chip-br-dark);
}

/* Table Header - Enhanced with Gradients */
#pysuricata-report .correlations-table.enhanced th {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.02));
  font-weight: 600;
  text-align: center;
  padding: 10px 8px;
  border-bottom: 2px solid var(--border-color);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  vertical-align: middle;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

#pysuricata-report:not(.light) .correlations-table.enhanced th {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border-bottom-color: var(--chip-br-dark);
}

/* Table Cell - Matching Common Values Styling */
#pysuricata-report .correlations-table.enhanced td {
  padding: 8px;
  border-bottom: 1px solid var(--chip-br-light);
  vertical-align: middle;
  text-align: center;
  font-size: 0.8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

#pysuricata-report:not(.light) .correlations-table.enhanced td {
  border-bottom-color: var(--chip-br-dark);
}

/* Remove border from last row like common values */
#pysuricata-report .correlations-table.enhanced tbody tr:last-child td {
  border-bottom: none;
}

/* Column Width Definitions - Fixed widths for consistent layout */
#pysuricata-report .correlations-table.enhanced .rank {
  width: 40px;
  min-width: 40px;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}

#pysuricata-report .correlations-table.enhanced .column {
  width: 30%; /* Flexible width for column names */
  min-width: 150px;
  max-width: 300px;
}

#pysuricata-report .correlations-table.enhanced .correlation-value {
  width: 110px;
  min-width: 110px;
  font-weight: 600;
  font-size: 0.8rem;
}

#pysuricata-report .correlations-table.enhanced .strength {
  width: 120px;
  min-width: 120px;
  font-weight: 500;
  font-size: 0.8rem;
}

/* Column Name Code Element - Fixed for Correlation Tables */
#pysuricata-report .correlations-table.enhanced .missing-col {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  line-height: 1.4;
}

#pysuricata-report:not(.light) .correlations-table.enhanced .missing-col {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

/* Correlation Value Colors */
#pysuricata-report .correlations-table.enhanced .correlation-value.positive {
  color: #059669;
}

#pysuricata-report .correlations-table.enhanced .correlation-value.negative {
  color: #dc2626;
}

/* Strength Colors - Plain Text */
#pysuricata-report .correlations-table.enhanced .strength[data-strength="very-strong"] {
  color: #dc267f;
  font-weight: 600;
}

#pysuricata-report .correlations-table.enhanced .strength[data-strength="strong"] {
  color: #ea580c;
  font-weight: 600;
}

#pysuricata-report .correlations-table.enhanced .strength[data-strength="moderate"] {
  color: #3b82f6;
}

#pysuricata-report .correlations-table.enhanced .strength[data-strength="weak"] {
  color: #6b7280;
}

/* ============================================================================
   DIRECTION COLUMN - Completely Redesigned (No Flexbox)
   Simple inline-block layout that works naturally with vertical-align: middle
   ============================================================================ */

/* Direction Column - Main Container */
#pysuricata-report .correlations-table.enhanced .direction {
  width: 120px;
  min-width: 120px;
  padding: 12px 8px;
  text-align: center; /* Ensure horizontal centering */
}

/* Direction Icon - Simple inline-block, no flexbox needed */
#pysuricata-report .correlations-table.enhanced .direction-icon {
  display: inline-block;
  font-size: 0.8rem;
  margin-right: 6px;
  vertical-align: middle;
  line-height: 1;
}

/* Direction Text - Simple inline-block, aligned with icon */
#pysuricata-report .correlations-table.enhanced .direction-text {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  vertical-align: middle;
  line-height: 1;
}

/* Enhanced Row Hover Effects - Match Common Values */
#pysuricata-report .correlations-table.enhanced tbody tr {
  transition: all 0.2s ease;
}

#pysuricata-report .correlations-table.enhanced tbody tr:hover {
  background: rgba(0, 0, 0, 0.02);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#pysuricata-report:not(.light) .correlations-table.enhanced tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* No Correlations State */
#pysuricata-report .no-correlations {
  text-align: center;
  padding: 24px;
  color: var(--text-secondary);
}

#pysuricata-report .no-correlations .icon {
  font-size: 2em;
  display: block;
  margin-bottom: 8px;
}

#pysuricata-report .no-correlations .message {
  font-weight: 500;
  display: block;
  margin-bottom: 4px;
}

/* ============================================================================
   RESPONSIVE DESIGN - Mobile & Tablet Optimizations
   ============================================================================ */

/* Tablet: Reduce spacing and font sizes */
@media (max-width: 1024px) {
  #pysuricata-report .correlations-table.enhanced {
    font-size: 0.75rem;
  }

  #pysuricata-report .correlations-table.enhanced td {
    padding: 8px 6px;
    font-size: 0.75rem;
  }

  #pysuricata-report .correlations-table.enhanced .missing-col {
    font-size: 0.75rem;
    padding: 3px 6px;
  }

  #pysuricata-report .correlations-table.enhanced .strength {
    font-size: 0.75rem;
  }

  /* Direction column adjustments for tablet */
  #pysuricata-report .correlations-table.enhanced .direction {
    width: 110px;
    min-width: 110px;
    padding: 8px 6px;
  }

  #pysuricata-report .correlations-table.enhanced .direction-icon {
    font-size: 0.75rem;
    margin-right: 5px;
  }

  #pysuricata-report .correlations-table.enhanced .direction-text {
    font-size: 0.75rem;
  }
}

/* Mobile: Further optimizations */
@media (max-width: 768px) {
  /* Add horizontal scroll wrapper if needed */
  #pysuricata-report .correlations-table.enhanced {
    font-size: 0.7rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  }

  #pysuricata-report .correlations-table.enhanced th,
  #pysuricata-report .correlations-table.enhanced td {
    padding: 6px 4px;
  }

  #pysuricata-report .correlations-table.enhanced .rank {
    width: 35px;
    min-width: 35px;
    font-size: 0.7rem;
  }

  #pysuricata-report .correlations-table.enhanced .column {
    min-width: 100px;
  }

  #pysuricata-report .correlations-table.enhanced .missing-col {
    font-size: 0.7rem;
    padding: 2px 4px;
  }

  #pysuricata-report .correlations-table.enhanced .correlation-value {
    width: 80px;
    min-width: 80px;
    font-size: 0.7rem;
  }

  #pysuricata-report .correlations-table.enhanced .strength {
    width: 90px;
    min-width: 90px;
    font-size: 0.65rem;
  }

  /* Direction column adjustments for mobile */
  #pysuricata-report .correlations-table.enhanced .direction {
    width: 90px;
    min-width: 90px;
    padding: 6px 3px;
  }

  #pysuricata-report .correlations-table.enhanced .direction-icon {
    font-size: 0.7rem;
    margin-right: 3px;
  }

  #pysuricata-report .correlations-table.enhanced .direction-text {
    font-size: 0.7rem;
  }

  /* Summary section mobile adjustments */
  #pysuricata-report .strength-breakdown {
    gap: 6px;
  }

  #pysuricata-report .strength-item {
    font-size: 0.75rem;
    padding: 3px 6px;
  }
}

/* Enhanced Missing Values Section Styling */
#pysuricata-report .missing-summary {
  margin-bottom: 16px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: 10px;
  border: 1px solid var(--chip-br-light);
}

#pysuricata-report .missing-summary .summary-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-weight: 600;
}

#pysuricata-report .missing-summary .icon {
  font-size: 1.3em;
}

#pysuricata-report .missing-summary .title {
  font-size: 1.1rem;
  color: var(--text-primary);
}

#pysuricata-report .quality-indicator {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#pysuricata-report .quality-indicator.critical {
  background: rgba(220, 38, 38, 0.15);
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.3);
}

#pysuricata-report .quality-indicator.high {
  background: rgba(234, 88, 12, 0.15);
  color: #ea580c;
  border: 1px solid rgba(234, 88, 12, 0.3);
}

#pysuricata-report .quality-indicator.medium {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

#pysuricata-report .quality-indicator.low {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

#pysuricata-report .data-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

#pysuricata-report .overview-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  border: 1px solid var(--chip-br-light);
}

#pysuricata-report .overview-item .label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#pysuricata-report .overview-item .value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

#pysuricata-report .overview-item .percentage {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

#pysuricata-report .overview-item.present {
  border-left: 4px solid #22c55e;
}

#pysuricata-report .overview-item.missing {
  border-left: 4px solid #dc2626;
}

/* Missing Values Visualization */
#pysuricata-report .missing-visualization {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: 10px;
  border: 1px solid var(--chip-br-light);
}

#pysuricata-report .progress-container {
  width: 100%;
}

#pysuricata-report .progress-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

#pysuricata-report .progress-bar {
  position: relative;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--chip-br-light);
}

#pysuricata-report .progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  transition: width 0.3s ease;
}

#pysuricata-report .progress-fill.present {
  background: linear-gradient(90deg, #22c55e, #16a34a);
  z-index: 2;
}

#pysuricata-report .progress-fill.missing {
  background: linear-gradient(90deg, #dc2626, #b91c1c);
  z-index: 1;
}

#pysuricata-report .progress-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.8rem;
}

#pysuricata-report .legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

#pysuricata-report .legend-item.present {
  color: #22c55e;
  font-weight: 500;
}

#pysuricata-report .legend-item.missing {
  color: #dc2626;
  font-weight: 500;
}

/* Quality Indicators Grid */
#pysuricata-report .quality-indicators {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: 10px;
  border: 1px solid var(--chip-br-light);
}

#pysuricata-report .indicators-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-weight: 600;
}

#pysuricata-report .indicators-header .icon {
  font-size: 1.2em;
}

#pysuricata-report .indicators-header .title {
  font-size: 1rem;
  color: var(--text-primary);
}

#pysuricata-report .indicators-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

#pysuricata-report .indicator-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  border: 1px solid var(--chip-br-light);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#pysuricata-report .indicator-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#pysuricata-report .indicator-item.critical {
  border-left: 4px solid #dc2626;
}

#pysuricata-report .indicator-item.high {
  border-left: 4px solid #ea580c;
}

#pysuricata-report .indicator-item.medium {
  border-left: 4px solid #f59e0b;
}

#pysuricata-report .indicator-item.low {
  border-left: 4px solid #22c55e;
}

#pysuricata-report .indicator-icon {
  font-size: 1.5em;
  flex-shrink: 0;
}

#pysuricata-report .indicator-content {
  flex: 1;
}

#pysuricata-report .indicator-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

#pysuricata-report .indicator-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

#pysuricata-report .indicator-description {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* Recommendations Section */
#pysuricata-report .recommendations {
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: 10px;
  border: 1px solid var(--chip-br-light);
}

#pysuricata-report .recommendations-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-weight: 600;
}

#pysuricata-report .recommendations-header .icon {
  font-size: 1.2em;
}

#pysuricata-report .recommendations-header .title {
  font-size: 1rem;
  color: var(--text-primary);
}

#pysuricata-report .recommendations-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#pysuricata-report .recommendation-item {
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  border: 1px solid var(--chip-br-light);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#pysuricata-report .recommendation-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#pysuricata-report .recommendation-item.critical {
  border-left: 4px solid #dc2626;
}

#pysuricata-report .recommendation-item.high {
  border-left: 4px solid #ea580c;
}

#pysuricata-report .recommendation-item.medium {
  border-left: 4px solid #f59e0b;
}

#pysuricata-report .recommendation-item.low {
  border-left: 4px solid #22c55e;
}

#pysuricata-report .recommendation-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

#pysuricata-report .recommendation-description {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Responsive Design for Missing Values */
@media (max-width: 768px) {
  #pysuricata-report .data-overview {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  #pysuricata-report .indicators-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  #pysuricata-report .indicator-item {
    padding: 10px;
  }

  #pysuricata-report .recommendation-item {
    padding: 10px 12px;
  }

  #pysuricata-report .missing-summary .summary-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  #pysuricata-report .quality-indicator {
    font-size: 0.8rem;
    padding: 4px 8px;
  }
}

/* =============================================================================
   ENHANCED MISSING VALUES PER CHUNK VISUALIZATION
   ============================================================================= */

/* Main container for the enhanced missing per chunk visualization */
#pysuricata-report .missing-per-chunk-enhanced {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--chip-br-light);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

#pysuricata-report .missing-per-chunk-enhanced:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

/* Header section */
#pysuricata-report .missing-per-chunk-enhanced .chunk-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

#pysuricata-report .missing-per-chunk-enhanced .chunk-header .icon {
  font-size: 1.25rem;
  opacity: 0.8;
}

#pysuricata-report .missing-per-chunk-enhanced .chunk-header .title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

#pysuricata-report .missing-per-chunk-enhanced .chunk-header .overall-stats {
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--chip-br-light);
}

/* Chunk bars container */
#pysuricata-report .missing-per-chunk-enhanced .chunk-bars {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

/* Individual chunk bar item */
#pysuricata-report .missing-per-chunk-enhanced .chunk-bar-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: 10px;
  border: 1px solid var(--chip-br-light);
  transition: all 0.2s ease;
  cursor: pointer;
}

#pysuricata-report .missing-per-chunk-enhanced .chunk-bar-item:hover {
  background: var(--hover-bg);
  border-radius: 6px 6px 0 0;
  border-color: var(--accent-color);
  transform: translateX(2px);
}

/* Chunk information section */
#pysuricata-report .missing-per-chunk-enhanced .chunk-info {
  display: flex;
  flex-direction: column;
  min-width: 140px;
  gap: 0.25rem;
}

#pysuricata-report .missing-per-chunk-enhanced .chunk-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

#pysuricata-report .missing-per-chunk-enhanced .chunk-stats {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

#pysuricata-report .missing-per-chunk-enhanced .chunk-size {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Chunk bar container */
#pysuricata-report .missing-per-chunk-enhanced .chunk-bar-container {
  flex: 1;
  height: 8px;
  background: var(--bg-primary);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--chip-br-light);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Chunk bar fill with severity-based colors */
#pysuricata-report .missing-per-chunk-enhanced .chunk-bar-fill {
  height: 100%;
  border-radius: 12px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

#pysuricata-report .missing-per-chunk-enhanced .chunk-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

/* Severity-based color schemes */
#pysuricata-report .missing-per-chunk-enhanced .chunk-bar-fill.low {
  background: linear-gradient(135deg, #10b981, #34d399);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

#pysuricata-report .missing-per-chunk-enhanced .chunk-bar-fill.medium {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

#pysuricata-report .missing-per-chunk-enhanced .chunk-bar-fill.high {
  background: linear-gradient(135deg, #ef4444, #f87171);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* Summary statistics section */
#pysuricata-report .missing-per-chunk-enhanced .chunk-summary {
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 10px;
  border: 1px solid var(--chip-br-light);
}

#pysuricata-report .missing-per-chunk-enhanced .summary-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
}

#pysuricata-report .missing-per-chunk-enhanced .stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.5rem;
  background: var(--bg-primary);
  border-radius: 6px;
  border: 1px solid var(--chip-br-light);
}

#pysuricata-report .missing-per-chunk-enhanced .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  font-weight: 500;
}

#pysuricata-report .missing-per-chunk-enhanced .stat-value {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Severity-specific styling for stat items */
#pysuricata-report .missing-per-chunk-enhanced .stat-item.severity-critical {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}

#pysuricata-report .missing-per-chunk-enhanced .stat-item.severity-high {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.05);
}

#pysuricata-report .missing-per-chunk-enhanced .stat-item.severity-medium {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}

#pysuricata-report .missing-per-chunk-enhanced .stat-item.severity-low {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.05);
}

/* Insights section */
#pysuricata-report .missing-per-chunk-enhanced .chunk-insights {
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 10px;
  border: 1px solid var(--chip-br-light);
}

#pysuricata-report .missing-per-chunk-enhanced .chunk-insights h5 {
  margin: 0 0 0.75rem 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

#pysuricata-report .missing-per-chunk-enhanced .insights-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

#pysuricata-report .missing-per-chunk-enhanced .insights-list li {
  padding: 0.5rem 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  position: relative;
  padding-left: 1.5rem;
}

#pysuricata-report .missing-per-chunk-enhanced .insights-list li:last-child {
  border-bottom: none;
}

#pysuricata-report .missing-per-chunk-enhanced .insights-list li::before {
  content: '💡';
  position: absolute;
  left: 0;
  top: 0.5rem;
  font-size: 0.8rem;
}

/* Legend section */
#pysuricata-report .missing-per-chunk-enhanced .chunk-legend {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

#pysuricata-report .missing-per-chunk-enhanced .legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#pysuricata-report .missing-per-chunk-enhanced .legend-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--chip-br-light);
}

#pysuricata-report .missing-per-chunk-enhanced .legend-color.low {
  background: linear-gradient(135deg, #10b981, #34d399);
}

#pysuricata-report .missing-per-chunk-enhanced .legend-color.medium {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

#pysuricata-report .missing-per-chunk-enhanced .legend-color.high {
  background: linear-gradient(135deg, #ef4444, #f87171);
}

#pysuricata-report .missing-per-chunk-enhanced .legend-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Dark mode adjustments */
#pysuricata-report:not(.light) .missing-per-chunk-enhanced {
  background: var(--card-bg);
  border-color: var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#pysuricata-report:not(.light) .missing-per-chunk-enhanced:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

#pysuricata-report:not(.light) .missing-per-chunk-enhanced .chunk-bar-container {
  background: var(--bg-primary);
  border-color: var(--border-color);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

#pysuricata-report:not(.light) .missing-per-chunk-enhanced .chunk-bar-fill::after {
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
}

/* Responsive design */
@media (max-width: 768px) {
  #pysuricata-report .missing-per-chunk-enhanced .chunk-bar-item {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  #pysuricata-report .missing-per-chunk-enhanced .chunk-info {
    min-width: auto;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  #pysuricata-report .missing-per-chunk-enhanced .summary-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  #pysuricata-report .missing-per-chunk-enhanced .chunk-legend {
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
  }
}

@media (max-width: 480px) {
  #pysuricata-report .missing-per-chunk-enhanced {
    padding: 1rem;
  }

  #pysuricata-report .missing-per-chunk-enhanced .chunk-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  #pysuricata-report .missing-per-chunk-enhanced .summary-stats {
    grid-template-columns: 1fr;
  }
}

/* =============================================================================
   SIMPLIFIED MISSING VALUES PER CHUNK VISUALIZATION
   ============================================================================= */

/* Main container for the simplified missing per chunk visualization */
#pysuricata-report .missing-per-chunk-simple {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--card-bg);
  border-radius: 10px;
  border: 1px solid var(--chip-br-light);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

/* Header section */
#pysuricata-report .missing-per-chunk-simple .chunk-header-simple {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

#pysuricata-report .missing-per-chunk-simple .chunk-header-simple .icon {
  font-size: 1rem;
  opacity: 0.8;
}

#pysuricata-report .missing-per-chunk-simple .chunk-header-simple .title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

#pysuricata-report .missing-per-chunk-simple .chunk-header-simple .overall-stats {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--chip-br-light);
}

/* Single bar container */
#pysuricata-report .missing-per-chunk-simple .chunk-bar-single {
  display: flex;
  height: 24px;
  background: var(--bg-primary);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--chip-br-light);
  margin-bottom: 1rem;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Individual chunk segments */
#pysuricata-report .missing-per-chunk-simple .chunk-segment {
  height: 100%;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
}

#pysuricata-report .missing-per-chunk-simple .chunk-segment:last-child {
  border-right: none;
}

#pysuricata-report .missing-per-chunk-simple .chunk-segment:hover {
  transform: scaleY(1.1);
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Segment content */
#pysuricata-report .missing-per-chunk-simple .segment-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 0.7rem;
  font-weight: 600;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

#pysuricata-report .missing-per-chunk-simple .segment-label {
  font-size: 0.6rem;
  opacity: 0.9;
  line-height: 1;
}

#pysuricata-report .missing-per-chunk-simple .segment-missing {
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}

/* Severity-based colors for segments */
#pysuricata-report .missing-per-chunk-simple .chunk-segment.low {
  background: linear-gradient(135deg, #10b981, #34d399);
}

#pysuricata-report .missing-per-chunk-simple .chunk-segment.medium {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

#pysuricata-report .missing-per-chunk-simple .chunk-segment.high {
  background: linear-gradient(135deg, #ef4444, #f87171);
}

/* Compact summary */
#pysuricata-report .missing-per-chunk-simple .chunk-summary-simple {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding: 0.5rem;
  background: var(--bg-secondary);
  border-radius: 4px;
  border: 1px solid var(--chip-br-light);
}

#pysuricata-report .missing-per-chunk-simple .summary-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
}

#pysuricata-report .missing-per-chunk-simple .summary-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
  font-weight: 500;
}

#pysuricata-report .missing-per-chunk-simple .summary-value {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Severity-specific styling for summary items */
#pysuricata-report .missing-per-chunk-simple .summary-item.severity-critical {
  color: #ef4444;
}

#pysuricata-report .missing-per-chunk-simple .summary-item.severity-high {
  color: #f59e0b;
}

#pysuricata-report .missing-per-chunk-simple .summary-item.severity-medium {
  color: #3b82f6;
}

#pysuricata-report .missing-per-chunk-simple .summary-item.severity-low {
  color: #10b981;
}

/* Simplified insights */
#pysuricata-report .missing-per-chunk-simple .chunk-insight-simple {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--bg-secondary);
  border-radius: 4px;
  border: 1px solid var(--chip-br-light);
  margin-bottom: 0.75rem;
}

#pysuricata-report .missing-per-chunk-simple .insight-icon {
  font-size: 0.8rem;
}

#pysuricata-report .missing-per-chunk-simple .insight-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* Simplified legend */
#pysuricata-report .missing-per-chunk-simple .chunk-legend-simple {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

#pysuricata-report .missing-per-chunk-simple .legend-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

#pysuricata-report .missing-per-chunk-simple .legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid var(--chip-br-light);
}

#pysuricata-report .missing-per-chunk-simple .legend-color.low {
  background: linear-gradient(135deg, #10b981, #34d399);
}

#pysuricata-report .missing-per-chunk-simple .legend-color.medium {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

#pysuricata-report .missing-per-chunk-simple .legend-color.high {
  background: linear-gradient(135deg, #ef4444, #f87171);
}

#pysuricata-report .missing-per-chunk-simple .legend-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Dark mode adjustments */
#pysuricata-report:not(.light) .missing-per-chunk-simple {
  background: var(--card-bg);
  border-color: var(--border-color);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

#pysuricata-report:not(.light) .missing-per-chunk-simple .chunk-bar-single {
  background: var(--bg-primary);
  border-color: var(--border-color);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Responsive design */
@media (max-width: 768px) {
  #pysuricata-report .missing-per-chunk-simple .chunk-header-simple {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }

  #pysuricata-report .missing-per-chunk-simple .chunk-summary-simple {
    flex-direction: column;
    gap: 0.5rem;
  }

  #pysuricata-report .missing-per-chunk-simple .chunk-legend-simple {
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
  }

  #pysuricata-report .missing-per-chunk-simple .segment-content {
    font-size: 0.6rem;
  }

  #pysuricata-report .missing-per-chunk-simple .segment-label {
    font-size: 0.5rem;
  }

  #pysuricata-report .missing-per-chunk-simple .segment-missing {
    font-size: 0.6rem;
  }
}

/* =============================================================================
   FIXES FOR ORDINAL NUMBERS AND CLICKABLE SECTIONS
   ============================================================================= */

/* Fix ordinal number spacing issues */
#pysuricata-report .rank {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  font-feature-settings: "tnum" 1;
  white-space: nowrap;
}

/* Ensure superscript characters render properly without spacing */
#pysuricata-report .rank sup,
#pysuricata-report .rank .superscript {
  font-size: 0.7em;
  line-height: 0;
  vertical-align: super;
  letter-spacing: 0;
  margin-left: -0.1em;
}

/* Alternative approach: use CSS for ordinal suffixes instead of Unicode */
#pysuricata-report .rank.ordinal-1::after {
  content: "st";
  font-size: 0.7em;
  vertical-align: super;
}

#pysuricata-report .rank.ordinal-2::after {
  content: "nd";
  font-size: 0.7em;
  vertical-align: super;
}

#pysuricata-report .rank.ordinal-3::after {
  content: "rd";
  font-size: 0.7em;
  vertical-align: super;
}

#pysuricata-report .rank.ordinal-4::after,
#pysuricata-report .rank.ordinal-5::after,
#pysuricata-report .rank.ordinal-6::after,
#pysuricata-report .rank.ordinal-7::after,
#pysuricata-report .rank.ordinal-8::after,
#pysuricata-report .rank.ordinal-9::after,
#pysuricata-report .rank.ordinal-10::after {
  content: "th";
  font-size: 0.7em;
  vertical-align: super;
}

/* Enhanced clickable section styling */
#pysuricata-report .details-toggle {
  position: relative;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#pysuricata-report .details-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  background: rgba(59, 130, 246, 0.25) !important;
  border-color: rgba(59, 130, 246, 0.6) !important;
}

#pysuricata-report .details-toggle:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Add subtle animation to indicate interactivity */
#pysuricata-report .details-toggle::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

#pysuricata-report .details-toggle:hover::before {
  opacity: 1;
}

/* Enhanced tab button styling */
#pysuricata-report .details-section .tabs [role="tab"] {
  position: relative;
  /* Only transition hover effects for smooth animations without delaying state changes */
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

#pysuricata-report .details-section .tabs [role="tab"]:hover:not(.active) {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.08) !important;
  border-color: var(--accent-color) !important;
}

#pysuricata-report:not(.light) .details-section .tabs [role="tab"]:hover:not(.active) {
  background: rgba(255, 255, 255, 0.12) !important;
}

#pysuricata-report .details-section .tabs [role="tab"]:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Enhanced button styling for all interactive elements */
#pysuricata-report .btn-soft {
  position: relative;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

#pysuricata-report .btn-soft:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#pysuricata-report .btn-soft:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Add cursor pointer to all clickable elements */
#pysuricata-report .details-toggle,
#pysuricata-report .details-section .tabs [role="tab"],
#pysuricata-report .btn-soft,
#pysuricata-report .card-controls button {
  cursor: pointer;
}

/* Add focus styles for accessibility */
#pysuricata-report .details-toggle:focus-visible,
#pysuricata-report .details-section .tabs [role="tab"]:focus-visible,
#pysuricata-report .btn-soft:focus-visible {
  outline: 2px solid #4ea3f1;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Dark mode adjustments for enhanced styling */
#pysuricata-report:not(.light) .details-toggle:hover {
  background: rgba(147, 197, 253, 0.25) !important;
  border-color: rgba(147, 197, 253, 0.6) !important;
}

#pysuricata-report:not(.light) .details-toggle::before {
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.05) 50%, transparent 70%);
}

#pysuricata-report:not(.light) .btn-soft:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Add subtle border animation for active states */
#pysuricata-report .details-toggle[aria-expanded="true"] {
  border-color: rgba(59, 130, 246, 0.7) !important;
  background: rgba(59, 130, 246, 0.2) !important;
}

/* =============================
   BTN-SOFT ACTIVE STATE STYLING
   ============================= */
/* Add active state styling for btn-soft buttons to make selected state visible */
#pysuricata-report .btn-soft.active {
  background: rgba(59, 130, 246, .4);
  border-color: #1e40af;
  border-width: 2px;
  color: #1e3a8a;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(30, 64, 175, 0.3);
}

#pysuricata-report:not(.light) .btn-soft.active {
  background: rgba(59, 130, 246, .35);
  border-color: rgba(59, 130, 246, .50);
  color: #dbeafe;
  font-weight: 600;
}

#pysuricata-report:not(.light) .details-toggle[aria-expanded="true"] {
  border-color: rgba(147, 197, 253, 0.7) !important;
  background: rgba(147, 197, 253, 0.2) !important;
}

/* =============================================================================
   DATAPREP-STYLE SPECTRUM VISUALIZATION
   ============================================================================= */

/* Main container for the DataPrep-style spectrum */
#pysuricata-report .dataprep-spectrum {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--chip-br-light);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

#pysuricata-report .dataprep-spectrum:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

/* Header section */
#pysuricata-report .dataprep-spectrum .spectrum-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

#pysuricata-report .dataprep-spectrum .spectrum-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

#pysuricata-report .dataprep-spectrum .spectrum-stats {
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--chip-br-light);
}

/* Main spectrum bar */
#pysuricata-report .dataprep-spectrum .spectrum-bar {
  display: flex;
  height: 24px;
  background: var(--bg-primary);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--chip-br-light);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}

/* Spectrum segments */
#pysuricata-report .dataprep-spectrum .spectrum-segment {
  height: 100%;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

#pysuricata-report .dataprep-spectrum .spectrum-segment:hover {
  transform: scaleY(1.1);
  z-index: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* DataPrep-style color scheme */
#pysuricata-report .dataprep-spectrum .spectrum-segment.spectrum-low {
  background: linear-gradient(135deg, #10b981, #34d399);
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.3);
}

#pysuricata-report .dataprep-spectrum .spectrum-segment.spectrum-medium {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  box-shadow: 0 1px 3px rgba(245, 158, 11, 0.3);
}

#pysuricata-report .dataprep-spectrum .spectrum-segment.spectrum-high {
  background: linear-gradient(135deg, #ef4444, #f87171);
  box-shadow: 0 1px 3px rgba(239, 68, 68, 0.3);
}

/* Subtle shimmer effect on hover */
#pysuricata-report .dataprep-spectrum .spectrum-segment::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

#pysuricata-report .dataprep-spectrum .spectrum-segment:hover::after {
  opacity: 1;
}

/* Summary section */
#pysuricata-report .dataprep-spectrum .spectrum-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: 10px;
  border: 1px solid var(--chip-br-light);
}

#pysuricata-report .dataprep-spectrum .severity-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  border: 1px solid;
}

#pysuricata-report .dataprep-spectrum .severity-indicator.low {
  color: #059669;
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}

#pysuricata-report .dataprep-spectrum .severity-indicator.medium {
  color: #d97706;
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
}

#pysuricata-report .dataprep-spectrum .severity-indicator.high {
  color: #dc2626;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

#pysuricata-report .dataprep-spectrum .severity-indicator.critical {
  color: #b91c1c;
  background: rgba(185, 28, 28, 0.1);
  border-color: rgba(185, 28, 28, 0.3);
}

#pysuricata-report .dataprep-spectrum .spectrum-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Legend section */
#pysuricata-report .dataprep-spectrum .spectrum-legend {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

#pysuricata-report .dataprep-spectrum .legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#pysuricata-report .dataprep-spectrum .legend-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--chip-br-light);
}

#pysuricata-report .dataprep-spectrum .legend-color.spectrum-low {
  background: linear-gradient(135deg, #10b981, #34d399);
}

#pysuricata-report .dataprep-spectrum .legend-color.spectrum-medium {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

#pysuricata-report .dataprep-spectrum .legend-color.spectrum-high {
  background: linear-gradient(135deg, #ef4444, #f87171);
}

#pysuricata-report .dataprep-spectrum .legend-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Dark mode adjustments */
#pysuricata-report:not(.light) .dataprep-spectrum {
  background: var(--card-bg);
  border-color: var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#pysuricata-report:not(.light) .dataprep-spectrum:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

#pysuricata-report:not(.light) .dataprep-spectrum .spectrum-bar {
  background: var(--bg-primary);
  border-color: var(--border-color);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

#pysuricata-report:not(.light) .dataprep-spectrum .spectrum-segment::after {
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
}

/* Responsive design */
@media (max-width: 768px) {
  #pysuricata-report .dataprep-spectrum .spectrum-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  #pysuricata-report .dataprep-spectrum .spectrum-summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  #pysuricata-report .dataprep-spectrum .spectrum-legend {
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
  }
}

@media (max-width: 480px) {
  #pysuricata-report .dataprep-spectrum {
    padding: 1rem;
  }

  #pysuricata-report .dataprep-spectrum .spectrum-bar {
    height: 8px;
  }
}

/* =============================================================================
   ULTRA-MINIMALISTIC VARIABLES PAGINATION
   ============================================================================= */

/* Ultra-clean controls */
#pysuricata-report .vars-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--card-bg);
  border-radius: 6px;
  border: 1px solid var(--chip-br-light);
}

/* Controls row - search first, then buttons */
#pysuricata-report .controls-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Search input */
#pysuricata-report .controls-row input {
  flex: 1;
  min-width: 200px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--chip-br-light);
  border-radius: 4px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.82rem;
}

/* Filter buttons container */
#pysuricata-report .filter-buttons {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

/* Filter button hover effects */
#pysuricata-report .filter-buttons button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  background: var(--hover-bg);
  border-color: var(--accent-color);
  border-radius: 6px !important;
  /* Override tab-like border-radius */
}

#pysuricata-report:not(.light) .filter-buttons button:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#pysuricata-report .controls-row input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

#pysuricata-report .controls-row input::placeholder {
  color: var(--text-muted);
}

/* Filter tabs */
#pysuricata-report .tab {
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--chip-br-light);
  border-radius: 3px;
  background: var(--bg-primary);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.8rem;
  white-space: nowrap;
  transition: all 0.2s ease;
}

#pysuricata-report .tab:focus {
  outline: none;
}

#pysuricata-report .tab:hover {
  background: var(--hover-bg);
  border-radius: 6px 6px 0 0;
  border-color: var(--accent-color);
  color: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
  transition: all 0.2s ease;
}

#pysuricata-report .tab.active {
  background: var(--bg-primary);
  color: var(--text-primary) !important;
  border-color: var(--accent-color);
  border-width: 2px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
  transform: translateY(-1px);
  position: relative;
  z-index: 1;
}

/* Dark mode adjustments for tabs */
#pysuricata-report:not(.light) .tab {
  background: var(--bg-primary);
  border-color: var(--border-color);
  color: var(--text-secondary);
}

#pysuricata-report:not(.light) .tab:hover {
  background: var(--hover-bg);
  border-radius: 6px 6px 0 0;
  border-color: var(--accent-color);
  color: var(--text-primary);
}

#pysuricata-report:not(.light) .tab.active {
  background: var(--bg-primary);
  color: var(--text-primary) !important;
  border-color: var(--accent-color);
  border-width: 2px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
  position: relative;
  z-index: 1;
}

/* Info */
#pysuricata-report .info {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.375rem;
  background: var(--bg-secondary);
  border-radius: 3px;
}

/* Pagination */
#pysuricata-report .pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

#pysuricata-report .pagination button {
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--chip-br-light);
  border-radius: 3px;
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

#pysuricata-report .pagination button:hover:not(:disabled) {
  background: var(--hover-bg);
  border-radius: 6px;
  border-color: var(--accent-color);
  color: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

#pysuricata-report .pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Page numbers */
#pysuricata-report .pages {
  display: flex;
  gap: 0.125rem;
}

#pysuricata-report .page-number {
  padding: 0.375rem 0.5rem;
  border: 1px solid var(--chip-br-light);
  border-radius: 3px;
  background: var(--bg-primary);
  color: var(--text-secondary);
  cursor: pointer;
  min-width: 1.75rem;
  text-align: center;
  font-size: 0.8rem;
}

#pysuricata-report .page-number:hover {
  background: var(--hover-bg);
  border-radius: 6px;
  border-color: var(--accent-color);
}

#pysuricata-report .page-number.active {
  background: var(--bg-primary);
  color: var(--text-primary);
  border-color: var(--accent-color);
  border-width: 2px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
  transform: translateY(-1px);
  position: relative;
  z-index: 1;
}

/* No results */
#pysuricata-report .no-results {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 1rem;
}

#pysuricata-report .no-results .icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

#pysuricata-report .no-results .message {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

#pysuricata-report .no-results .suggestion {
  font-size: 0.85rem;
  opacity: 0.8;
}

/* Dark mode */
#pysuricata-report:not(.light) .vars-controls {
  background: var(--card-bg);
  border-color: var(--border-color);
}

#pysuricata-report:not(.light) .controls-row input {
  background: var(--bg-primary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

#pysuricata-report:not(.light) .controls-row input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

#pysuricata-report:not(.light) .tab {
  background: var(--bg-primary);
  border-color: var(--border-color);
  color: var(--text-secondary);
}

#pysuricata-report:not(.light) .tab:hover {
  background: var(--hover-bg);
  border-radius: 6px 6px 0 0;
  border-color: var(--accent-color);
  color: var(--text-primary);
}

#pysuricata-report:not(.light) .tab.active {
  background: var(--bg-primary);
  color: var(--text-primary) !important;
  border-color: var(--accent-color);
  border-width: 2px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
  position: relative;
  z-index: 1;
}

#pysuricata-report:not(.light) .pagination button {
  background: var(--bg-primary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

#pysuricata-report:not(.light) .pagination button:hover:not(:disabled) {
  background: var(--hover-bg);
  border-radius: 6px;
  border-color: var(--accent-color);
  color: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

#pysuricata-report:not(.light) .page-number {
  background: var(--bg-primary);
  border-color: var(--border-color);
  color: var(--text-secondary);
}

#pysuricata-report:not(.light) .page-number:hover {
  background: var(--hover-bg);
  border-radius: 6px;
  border-color: var(--accent-color);
}

/* Responsive */
@media (max-width: 768px) {
  #pysuricata-report .vars-controls {
    padding: 0.75rem;
  }

  #pysuricata-report .controls-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  #pysuricata-report .controls-row input {
    min-width: auto;
  }

  #pysuricata-report .filter-buttons {
    justify-content: center;
  }

  #pysuricata-report .pagination {
    flex-direction: column;
    gap: 0.5rem;
  }

  #pysuricata-report .pages {
    order: -1;
  }
}

@media (max-width: 480px) {
  #pysuricata-report .controls-row {
    gap: 0.375rem;
  }

  #pysuricata-report .filter-buttons {
    flex-direction: column;
  }

  #pysuricata-report .tab {
    text-align: center;
  }
}


/* Theme-aware Boolean Chart Styling */
.boolean-chart.enhanced {
  padding: 16px;
  background: var(--chart-bg-light, linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%));
  border-radius: 12px;
  border: 1px solid var(--chart-border-light, #e2e8f0);
  box-shadow: var(--chart-shadow-light, 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06));
  transition: all 0.3s ease;
}

.boolean-chart.enhanced:hover {
  box-shadow: var(--chart-shadow-hover-light, 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05));
  transform: translateY(-2px);
}

.chart-container {
  position: relative;
}

.bool-svg.enhanced {
  border-radius: 10px;
  background: var(--svg-bg-light, white);
  box-shadow: var(--svg-shadow-light, inset 0 2px 4px rgba(0, 0, 0, 0.06));
}

/* Enhanced segment styling with hover effects */
.seg.enhanced {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  stroke: var(--segment-stroke-light, rgba(255, 255, 255, 0.2));
  stroke-width: 1;
}

.seg.enhanced:hover {
  transform: scaleY(1.1);
  transform-origin: center;
  filter: brightness(1.1) var(--segment-shadow-hover-light, drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15)));
  stroke-width: 2;
  stroke: var(--segment-stroke-hover-light, rgba(255, 255, 255, 0.4));
}

.seg.true.enhanced:hover {
  filter: brightness(1.15) var(--segment-shadow-true-light, drop-shadow(0 4px 8px rgba(16, 185, 129, 0.3)));
}

.seg.false.enhanced:hover {
  filter: brightness(1.15) var(--segment-shadow-false-light, drop-shadow(0 4px 8px rgba(239, 68, 68, 0.3)));
}

.seg.missing.enhanced:hover {
  filter: brightness(1.15) var(--segment-shadow-missing-light, drop-shadow(0 4px 8px rgba(107, 114, 128, 0.3)));
}

/* Enhanced label styling */
.label.enhanced {
  transition: all 0.2s ease;
  text-shadow: var(--label-shadow-light, 0 1px 2px rgba(0, 0, 0, 0.5));
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.seg.enhanced:hover+.label.enhanced,
.seg.enhanced:hover~.label.enhanced {
  font-size: 13px;
  font-weight: 700;
  text-shadow: var(--label-shadow-hover-light, 0 2px 4px rgba(0, 0, 0, 0.7));
}

/* Chart legend styling */
.chart-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 12px;
  padding: 8px 0;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--legend-bg-light, rgba(255, 255, 255, 0.8));
  border: 1px solid var(--legend-border-light, rgba(0, 0, 0, 0.1));
  transition: all 0.2s ease;
  cursor: pointer;
}

.legend-item:hover {
  background: var(--legend-bg-hover-light, rgba(255, 255, 255, 1));
  box-shadow: var(--legend-shadow-hover-light, 0 2px 4px rgba(0, 0, 0, 0.1));
  transform: translateY(-1px);
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  box-shadow: var(--legend-color-shadow-light, 0 1px 2px rgba(0, 0, 0, 0.2));
}

.legend-color.true {
  background: linear-gradient(135deg, #10b981, #059669);
}

.legend-color.false {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.legend-color.missing {
  background: linear-gradient(135deg, #6b7280, #4b5563);
}

.legend-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--legend-text-light, #374151);
}

/* Animation for chart loading */
@keyframes chartLoad {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.boolean-chart.enhanced {
  animation: chartLoad 0.5s ease-out;
}

/* Dark theme overrides */
#pysuricata-report:not(.light) .boolean-chart.enhanced {
  background: var(--chart-bg-dark, linear-gradient(135deg, #1f2937 0%, #111827 100%));
  border-color: var(--chart-border-dark, #374151);
  box-shadow: var(--chart-shadow-dark, 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2));
}

#pysuricata-report:not(.light) .boolean-chart.enhanced:hover {
  box-shadow: var(--chart-shadow-hover-dark, 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3));
}

#pysuricata-report:not(.light) .bool-svg.enhanced {
  background: var(--svg-bg-dark, #1f2937);
  box-shadow: var(--svg-shadow-dark, inset 0 2px 4px rgba(0, 0, 0, 0.2));
}

#pysuricata-report:not(.light) .seg.enhanced {
  stroke: var(--segment-stroke-dark, rgba(255, 255, 255, 0.1));
}

#pysuricata-report:not(.light) .seg.enhanced:hover {
  filter: brightness(1.1) var(--segment-shadow-hover-dark, drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4)));
  stroke: var(--segment-stroke-hover-dark, rgba(255, 255, 255, 0.2));
}

#pysuricata-report:not(.light) .seg.true.enhanced:hover {
  filter: brightness(1.15) var(--segment-shadow-true-dark, drop-shadow(0 4px 8px rgba(16, 185, 129, 0.4)));
}

#pysuricata-report:not(.light) .seg.false.enhanced:hover {
  filter: brightness(1.15) var(--segment-shadow-false-dark, drop-shadow(0 4px 8px rgba(239, 68, 68, 0.4)));
}

#pysuricata-report:not(.light) .seg.missing.enhanced:hover {
  filter: brightness(1.15) var(--segment-shadow-missing-dark, drop-shadow(0 4px 8px rgba(107, 114, 128, 0.4)));
}

#pysuricata-report:not(.light) .label.enhanced {
  text-shadow: var(--label-shadow-dark, 0 1px 2px rgba(0, 0, 0, 0.8));
}

#pysuricata-report:not(.light) .seg.enhanced:hover+.label.enhanced,
#pysuricata-report:not(.light) .seg.enhanced:hover~.label.enhanced {
  text-shadow: var(--label-shadow-hover-dark, 0 2px 4px rgba(0, 0, 0, 0.9));
}

#pysuricata-report:not(.light) .legend-item {
  background: var(--legend-bg-dark, rgba(31, 41, 55, 0.8));
  border-color: var(--legend-border-dark, rgba(255, 255, 255, 0.1));
}

#pysuricata-report:not(.light) .legend-item:hover {
  background: var(--legend-bg-hover-dark, rgba(31, 41, 55, 1));
  box-shadow: var(--legend-shadow-hover-dark, 0 2px 4px rgba(0, 0, 0, 0.3));
}

#pysuricata-report:not(.light) .legend-color {
  box-shadow: var(--legend-color-shadow-dark, 0 1px 2px rgba(0, 0, 0, 0.4));
}

#pysuricata-report:not(.light) .legend-label {
  color: var(--legend-text-dark, #d1d5db);
}

/* Responsive design */
@media (max-width: 768px) {
  .chart-legend {
    flex-wrap: wrap;
    gap: 12px;
  }

  .legend-item {
    font-size: 11px;
  }

  .legend-color {
    width: 10px;
    height: 10px;
  }
}

/* Responsive design */
@media (max-width: 768px) {
  .chart-legend {
    flex-wrap: wrap;
    gap: 12px;
  }

  .legend-item {
    font-size: 11px;
  }

  .legend-color {
    width: 10px;
    height: 10px;
  }
}

/* =============================
   MISSING VALUES HEATMAP
   ============================= */
#pysuricata-report .missing-values-heatmap {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

#pysuricata-report .heatmap-header {
  margin-bottom: 1rem;
}

#pysuricata-report .heatmap-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
}

#pysuricata-report .heatmap-stats {
  display: flex;
  gap: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

#pysuricata-report .heatmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: 4px;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

#pysuricata-report .heatmap-legend .legend-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-right: 0.5rem;
}

#pysuricata-report .heatmap-legend .legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

#pysuricata-report .heatmap-legend .color-box {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: middle;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

#pysuricata-report .heatmap-legend .color-box.hm-none {
  background: #e5e7eb;
}

#pysuricata-report .heatmap-legend .color-box.hm-low {
  background: #86efac;
}

#pysuricata-report .heatmap-legend .color-box.hm-medium {
  background: #fbbf24;
}

#pysuricata-report .heatmap-legend .color-box.hm-high {
  background: #fb923c;
}

#pysuricata-report .heatmap-legend .color-box.hm-critical {
  background: #ef4444;
}

#pysuricata-report .heatmap-container {
  overflow-x: auto;
}

#pysuricata-report .heatmap-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#pysuricata-report .heatmap-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1rem;
  align-items: center;
  padding: 0.5rem;
  background: var(--bg-surface);
  border-radius: 4px;
  transition: background 0.2s ease;
}

#pysuricata-report .heatmap-row:hover {
  background: var(--bg-secondary);
}

#pysuricata-report .heatmap-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#pysuricata-report .heatmap-label code {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
}

#pysuricata-report .heatmap-label .missing-summary {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

#pysuricata-report .heatmap-spectrum {
  height: 24px;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

#pysuricata-report .hm-segment {
  height: 100%;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

#pysuricata-report .hm-segment:hover {
  transform: scaleY(1.2);
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

#pysuricata-report .hm-segment.hm-none {
  background: #e5e7eb;
}

#pysuricata-report .hm-segment.hm-low {
  background: linear-gradient(180deg, #86efac 0%, #4ade80 100%);
}

#pysuricata-report .hm-segment.hm-medium {
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
}

#pysuricata-report .hm-segment.hm-high {
  background: linear-gradient(180deg, #fb923c 0%, #f97316 100%);
}

#pysuricata-report .hm-segment.hm-critical {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
}

#pysuricata-report .heatmap-expandable {
  margin-top: 8px;
}

#pysuricata-report .expand-heatmap-btn {
  margin-top: 1rem;
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-primary);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

#pysuricata-report .expand-heatmap-btn:hover {
  background: var(--hover-bg);
  border-color: var(--accent-color);
}

/* Responsive heatmap */
@media (max-width: 768px) {
  #pysuricata-report .heatmap-row {
    grid-template-columns: 1fr;
  }

  #pysuricata-report .heatmap-label {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
  }
}

/* =============================
   DETAILS -> MISSING VALUES TAB (IN VARIABLE CARDS)
   ============================= */

/* Spacing for sections within missing tab */
#pysuricata-report .tab-pane[data-tab="missing"] .missing-analysis-header,
#pysuricata-report .tab-pane[data-tab="missing"] .chunk-distribution {
  margin-bottom: 1rem;
}

/* Section titles - only in missing tab */
#pysuricata-report .tab-pane[data-tab="missing"] h4.section-title,
#pysuricata-report .tab-pane[data-tab="missing"] .section-title,
#pysuricata-report .tab-pane[data-tab="missing"] .missing-analysis-header h4,
#pysuricata-report .tab-pane[data-tab="missing"] .chunk-distribution h4 {
  font-size: 0.95rem !important;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

#pysuricata-report:not(.light) .tab-pane[data-tab="missing"] h4.section-title,
#pysuricata-report:not(.light) .tab-pane[data-tab="missing"] .section-title,
#pysuricata-report:not(.light) .tab-pane[data-tab="missing"] .missing-analysis-header h4,
#pysuricata-report:not(.light) .tab-pane[data-tab="missing"] .chunk-distribution h4 {
  color: var(--text-primary);
  border-bottom-color: var(--border-color);
}

/* Data Completeness - scoped to missing tab */
#pysuricata-report .tab-pane[data-tab="missing"] .completeness-container {
  margin-bottom: 2rem;
}

#pysuricata-report .tab-pane[data-tab="missing"] .completeness-stats {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

#pysuricata-report .tab-pane[data-tab="missing"] .stat-item {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
}

#pysuricata-report .tab-pane[data-tab="missing"] .stat-label {
  font-weight: 500;
  color: var(--text-secondary);
}

#pysuricata-report:not(.light) .tab-pane[data-tab="missing"] .stat-label {
  color: var(--text-secondary);
}

#pysuricata-report .tab-pane[data-tab="missing"] .stat-value {
  font-weight: 600;
  color: var(--text-primary);
}

#pysuricata-report:not(.light) .tab-pane[data-tab="missing"] .stat-value {
  color: var(--text-primary);
}

#pysuricata-report .tab-pane[data-tab="missing"] .stat-pct {
  font-weight: 400;
  opacity: 0.8;
}

/* Completeness Bar - scoped to missing tab */
#pysuricata-report .tab-pane[data-tab="missing"] .completeness-bar {
  height: 24px;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--divider-light);
}

#pysuricata-report:not(.light) .tab-pane[data-tab="missing"] .completeness-bar {
  background: var(--bg-secondary);
  border-color: var(--divider-dark);
}

#pysuricata-report .tab-pane[data-tab="missing"] .completeness-bar .bar-fill {
  height: 100%;
  transition: width 0.3s ease;
}

#pysuricata-report .tab-pane[data-tab="missing"] .completeness-bar .bar-fill.present {
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
}

#pysuricata-report .tab-pane[data-tab="missing"] .completeness-bar .bar-fill.missing {
  background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
}

/* Chunk Distribution - scoped to missing tab */
#pysuricata-report .tab-pane[data-tab="missing"] .chunk-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

#pysuricata-report:not(.light) .tab-pane[data-tab="missing"] .chunk-info {
  color: var(--text-secondary);
}

#pysuricata-report .tab-pane[data-tab="missing"] .chunk-spectrum {
  height: 24px;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--divider-light);
  margin-bottom: 0.75rem;
}

#pysuricata-report:not(.light) .tab-pane[data-tab="missing"] .chunk-spectrum {
  background: var(--bg-secondary);
  border-color: var(--divider-dark);
}

#pysuricata-report .tab-pane[data-tab="missing"] .chunk-segment {
  height: 100%;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

#pysuricata-report .tab-pane[data-tab="missing"] .chunk-segment:hover {
  opacity: 0.8;
  transform: scaleY(1.1);
  z-index: 10;
}

#pysuricata-report .tab-pane[data-tab="missing"] .chunk-segment.low {
  background: #4caf50;
}

#pysuricata-report .tab-pane[data-tab="missing"] .chunk-segment.medium {
  background: #ff9800;
}

#pysuricata-report .tab-pane[data-tab="missing"] .chunk-segment.high {
  background: #f44336;
}

/* Enhanced Tooltip Styling for Chunk Segments */
#pysuricata-report .tab-pane[data-tab="missing"] .chunk-segment::before {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.95);
  color: white;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  max-width: 300px;
  text-align: center;
}

#pysuricata-report:not(.light) .tab-pane[data-tab="missing"] .chunk-segment::before {
  background: rgba(255, 255, 255, 0.98);
  color: #1a1a1a;
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

#pysuricata-report .tab-pane[data-tab="missing"] .chunk-segment::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 1000;
  pointer-events: none;
}

#pysuricata-report:not(.light) .tab-pane[data-tab="missing"] .chunk-segment::after {
  border-top-color: rgba(255, 255, 255, 0.98);
}

#pysuricata-report .tab-pane[data-tab="missing"] .chunk-segment:hover::before,
#pysuricata-report .tab-pane[data-tab="missing"] .chunk-segment:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-5px);
}

#pysuricata-report .tab-pane[data-tab="missing"] .chunk-segment:hover::after {
  transform: translateX(-50%) translateY(95%);
}

/* Legend - scoped to missing tab */
#pysuricata-report .tab-pane[data-tab="missing"] .chunk-legend {
  display: flex;
  gap: 1.5rem;
  font-size: 0.85rem;
  justify-content: center;
}

#pysuricata-report .tab-pane[data-tab="missing"] .legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#pysuricata-report .tab-pane[data-tab="missing"] .color-box {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

#pysuricata-report:not(.light) .tab-pane[data-tab="missing"] .color-box {
  border-color: rgba(255, 255, 255, 0.2);
}

#pysuricata-report .tab-pane[data-tab="missing"] .color-box.low {
  background: #4caf50;
}

#pysuricata-report .tab-pane[data-tab="missing"] .color-box.medium {
  background: #ff9800;
}

#pysuricata-report .tab-pane[data-tab="missing"] .color-box.high {
  background: #f44336;
}

/* Missing Values Section */
#pysuricata-report #missing-values {
  margin-top: 0;
}

#pysuricata-report .missing-section-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 1.5rem;
}

#pysuricata-report .missing-section-tabs button {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  position: relative;
  z-index: 10;
  pointer-events: auto;
  border-radius: 6px 6px 0 0;
  min-width: 120px;
  text-align: center;
}

#pysuricata-report .missing-section-tabs button.active {
  color: var(--text-primary);
  border-bottom-color: var(--bar);
}

#pysuricata-report .missing-section-tabs button:hover {
  color: var(--text-primary);
  background: var(--hover-bg);
  border-radius: 6px 6px 0 0;
}

#pysuricata-report .missing-tab-content {
  display: none;
}

#pysuricata-report .missing-tab-content.active {
  display: block;
}

/* =============================================================================
   REDESIGNED MISSING VALUES SECTION - TWO COMPACT TABS (2024)
   Tab 1: Data Completeness (40px rows) - name, stats, bar
   Tab 2: Missing per Chunk (35px rows) - name, spectrum only
   ============================================================================= */

/* Main container for redesigned missing values section - Card-style container */
#pysuricata-report .missing-values-section-redesign {
  margin-top: 0;
  padding: 20px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--chip-br-light);
  border-radius: 10px;
  transition: background-color 0.2s ease;
}

#pysuricata-report:not(.light) .missing-values-section-redesign {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--chip-br-dark);
}

/* Tabs and badge header (no title, no separator line) */
#pysuricata-report .missing-tabs-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 1rem;
}

#pysuricata-report .missing-count-badge {
  padding: 0.5rem 1rem;
  background: var(--chip-bg);
  border: 1px solid var(--chip-br);
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  align-self: center;
}

/* Tab navigation */
#pysuricata-report .missing-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--border-color);
  flex: 1;
}

#pysuricata-report .missing-tabs button {
  padding: 10px 20px;
  border: none;
  background: transparent;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

#pysuricata-report .missing-tabs button.active {
  border-bottom-color: var(--accent-color);
  color: var(--text-primary);
  font-weight: 600;
}

#pysuricata-report .missing-tabs button:hover {
  color: var(--text-primary);
  background: rgba(59, 130, 246, 0.05);
  border-radius: 6px 6px 0 0;
}

#pysuricata-report:not(.light) .missing-tabs button:hover {
  background: rgba(59, 130, 246, 0.1);
}

/* Tab content areas */
#pysuricata-report .missing-tab-content {
  display: none;
}

#pysuricata-report .missing-tab-content.active {
  display: block;
}

/* Scrollable list container (both tabs) */
#pysuricata-report .scrollable-list {
  max-height: 600px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  margin-bottom: 1.5rem;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}

/* Custom scrollbar styling - matching Sample section format */
#pysuricata-report .scrollable-list::-webkit-scrollbar {
  width: 10px;
}

#pysuricata-report .scrollable-list::-webkit-scrollbar-track {
  background: var(--scroll-track);
}

#pysuricata-report .scrollable-list::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

#pysuricata-report .scrollable-list::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.45);
}

#pysuricata-report:not(.light) .scrollable-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.45);
}

/* =============================================================================
   TAB 1: DATA COMPLETENESS (40px rows)
   Compact rows showing: column name | stats | bar
   ============================================================================= */

#pysuricata-report .compact-row {
  height: 32px;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 12px;
  align-items: center;
  padding: 6px 12px;
  border-bottom: 1px solid var(--divider);
  transition: background 0.15s ease;
}

#pysuricata-report .compact-row:hover {
  background: rgba(59, 130, 246, 0.04);
}

#pysuricata-report:not(.light) .compact-row:hover {
  background: rgba(59, 130, 246, 0.08);
}

#pysuricata-report .compact-row .col-name {
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Chip-style formatting for column names (matching top missing columns) */
#pysuricata-report .compact-row .col-name.missing-col {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
  width: fit-content;
  display: inline-block;
  justify-self: start;
}

#pysuricata-report:not(.light) .compact-row .col-name.missing-col {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}

#pysuricata-report .compact-row .stats {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

#pysuricata-report .compact-row .pct {
  color: var(--text-secondary);
  font-weight: 500;
}

#pysuricata-report .compact-row .bar {
  height: 20px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

#pysuricata-report .compact-row .fill {
  height: 100%;
  transition: width 0.3s ease;
}

#pysuricata-report .compact-row .fill.low {
  background: linear-gradient(90deg, #4caf50 0%, #66bb6a 100%);
}

#pysuricata-report .compact-row .fill.medium {
  background: linear-gradient(90deg, #ff9800 0%, #ffb74d 100%);
}

#pysuricata-report .compact-row .fill.high {
  background: linear-gradient(90deg, #f44336 0%, #ef5350 100%);
}

/* Dual-color completeness bar styles */
#pysuricata-report .compact-row .completeness-bar-dual {
  height: 18px;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--divider-light);
}

#pysuricata-report:not(.light) .compact-row .completeness-bar-dual {
  background: var(--bg-secondary);
  border-color: var(--divider-dark);
}

#pysuricata-report .compact-row .completeness-bar-dual .bar-fill.present {
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
}

#pysuricata-report .compact-row .completeness-bar-dual .bar-fill.missing {
  background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
}

/* Enhanced tooltip styling for dual-color bar segments */
#pysuricata-report .missing-values-section-redesign .compact-row .completeness-bar-dual .bar-fill {
  position: relative;
  height: 100%;
  transition: width 0.3s ease;
  cursor: help;
}

#pysuricata-report .missing-values-section-redesign .compact-row .completeness-bar-dual .bar-fill::before {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.95);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
}

/* Tooltip arrow */
#pysuricata-report .missing-values-section-redesign .compact-row .completeness-bar-dual .bar-fill::after {
  content: '';
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.95);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 1000;
  pointer-events: none;
}

/* Show tooltip on hover */
#pysuricata-report .missing-values-section-redesign .compact-row .completeness-bar-dual .bar-fill:hover::before,
#pysuricata-report .missing-values-section-redesign .compact-row .completeness-bar-dual .bar-fill:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Dark mode variant */
#pysuricata-report:not(.light) .missing-values-section-redesign .compact-row .completeness-bar-dual .bar-fill::before {
  background: rgba(255, 255, 255, 0.98);
  color: #1a1a1a;
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

#pysuricata-report:not(.light) .missing-values-section-redesign .compact-row .completeness-bar-dual .bar-fill::after {
  border-top-color: rgba(255, 255, 255, 0.98);
}

/* =============================================================================
   TAB 2: MISSING PER CHUNK - SPECTRUM BARS
   Compact rows with horizontal spectrum bars showing chunk distribution
   ============================================================================= */

/* Missing per Chunk - Spectrum Bar (matching numeric card format) */
#pysuricata-report .chunk-spectrum {
  height: 18px;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--divider);
}

#pysuricata-report .chunk-segment {
  height: 100%;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

#pysuricata-report .chunk-segment:hover {
  filter: brightness(1.1);
  transform: scaleY(1.15);
  z-index: 5;
}

/* Severity colors for chunk segments */
#pysuricata-report .chunk-segment.low {
  background: #4caf50;
}

#pysuricata-report .chunk-segment.medium {
  background: #ff9800;
}

#pysuricata-report .chunk-segment.high {
  background: #f44336;
}

/* Missing per Chunk - Legend */
#pysuricata-report .chunk-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: var(--bg-secondary);
  border-radius: 6px;
  border: 1px solid var(--divider);
  font-size: 0.85rem;
}

#pysuricata-report .chunk-legend .legend-label {
  font-weight: 600;
  color: var(--text-primary);
  margin-right: 4px;
}

#pysuricata-report .chunk-legend .legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

#pysuricata-report .chunk-legend .legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
}

#pysuricata-report .chunk-legend .legend-color.low {
  background: #4caf50;
}

#pysuricata-report .chunk-legend .legend-color.medium {
  background: #ff9800;
}

#pysuricata-report .chunk-legend .legend-color.high {
  background: #f44336;
}

#pysuricata-report .chunk-legend .legend-text {
  color: var(--text-secondary);
  font-weight: 500;
}

/* No missing state (both tabs) */
#pysuricata-report .no-missing-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

#pysuricata-report .no-missing-state .icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #4caf50;
}

#pysuricata-report .no-missing-state p {
  margin: 0;
  font-size: 1rem;
  color: var(--text-secondary);
}

/* No chunk data state */
#pysuricata-report .no-chunk-data-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

#pysuricata-report .no-chunk-data-state .icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #3b82f6;
}

#pysuricata-report .no-chunk-data-state p {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  color: var(--text-secondary);
}

#pysuricata-report .no-chunk-data-state p.small {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

/* Legend styling */
#pysuricata-report .missing-values-section-redesign .missing-legend {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  font-size: 0.875rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

#pysuricata-report .missing-legend .legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

#pysuricata-report .missing-legend .color-box {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

#pysuricata-report:not(.light) .missing-legend .color-box {
  border-color: rgba(255, 255, 255, 0.2);
}

#pysuricata-report .missing-legend .color-box.low {
  background: #4caf50;
}

#pysuricata-report .missing-legend .color-box.medium {
  background: #ff9800;
}

#pysuricata-report .missing-legend .color-box.high {
  background: #f44336;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #pysuricata-report .missing-tabs-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  #pysuricata-report .missing-count-badge {
    align-self: flex-start;
  }

  #pysuricata-report .compact-row {
    grid-template-columns: 1fr;
    height: auto;
    gap: 8px;
    padding: 12px;
  }

  #pysuricata-report .compact-row .bar {
    width: 100%;
  }

  #pysuricata-report .compact-row .completeness-bar-dual {
    width: 100%;
  }

  #pysuricata-report .chunk-row {
    grid-template-columns: 1fr;
    height: auto;
    gap: 8px;
  }

  #pysuricata-report .chunk-row .short-name {
    margin-bottom: 4px;
  }

  #pysuricata-report .scrollable-list {
    max-height: 500px;
  }
}

/* =============================================================================
   CORRELATIONS SECTION (2024)
   Modern scrollable view similar to missing values section
   ============================================================================= */

/* Main container for correlations section */
#pysuricata-report .correlations-section-redesign {
  margin-top: 0;
  padding: 20px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--chip-br-light);
  border-radius: 10px;
  transition: background-color 0.2s ease;
}

#pysuricata-report:not(.light) .correlations-section-redesign {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--chip-br-dark);
}

/* Header section with title and count badge */
#pysuricata-report .correlation-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border-color);
}

#pysuricata-report .correlation-section-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

#pysuricata-report .correlation-count-badge {
  padding: 0.5rem 1rem;
  background: var(--chip-bg);
  border: 1px solid var(--chip-br);
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Legend header for list view (replaces title with legend) */
#pysuricata-report .correlation-legend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border-color);
  flex-wrap: wrap;
  gap: 1rem;
}

#pysuricata-report .correlation-legend-header .correlation-legend {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0;
  background: transparent;
  border-radius: 0;
  font-size: 0.875rem;
}

/* Scrollable container for correlation rows */
#pysuricata-report .correlations-container {
  max-height: 600px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  margin-bottom: 1.5rem;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}

/* Custom scrollbar styling - matching Missing Values section format */
#pysuricata-report .correlations-container::-webkit-scrollbar {
  width: 10px;
}

#pysuricata-report .correlations-container::-webkit-scrollbar-track {
  background: var(--scroll-track);
}

#pysuricata-report .correlations-container::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

#pysuricata-report .correlations-container::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.45);
}

#pysuricata-report:not(.light) .correlations-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.45);
}

/* Individual correlation row */
#pysuricata-report .correlation-row {
  margin-bottom: 0.75rem;
  padding: 0.5rem;
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

#pysuricata-report .correlation-row:hover {
  border-color: var(--accent-color);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

#pysuricata-report:not(.light) .correlation-row:hover {
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

/* Correlation row header: rank, column pair, value */
#pysuricata-report .correlation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  gap: 1rem;
  flex-wrap: wrap;
}

#pysuricata-report .rank-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--chip-bg);
  padding: 3px 6px;
  border-radius: 4px;
  min-width: 32px;
  text-align: center;
}

#pysuricata-report .col-pair {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

#pysuricata-report .col-pair .col-name {
  color: var(--text-primary);
}

/* Column name chip format for correlations */
#pysuricata-report .col-pair .col-name.correlation-col {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
  display: inline-block;
}

#pysuricata-report:not(.light) .col-pair .col-name.correlation-col {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}

#pysuricata-report .col-pair .arrow {
  color: var(--text-secondary);
  opacity: 0.6;
  font-size: 0.85rem;
}

#pysuricata-report .correlation-value {
  font-size: 0.9rem;
  font-weight: 700;
  font-family: ui-monospace, monospace;
  padding: 3px 8px;
  border-radius: 4px;
  min-width: 70px;
  text-align: center;
}

#pysuricata-report .correlation-value.positive {
  color: #4caf50;
  background: rgba(76, 175, 80, 0.1);
}

#pysuricata-report .correlation-value.negative {
  color: #f44336;
  background: rgba(244, 67, 54, 0.1);
}

/* Correlation strength bar */
#pysuricata-report .correlation-bar {
  height: 16px;
  background: var(--bg-secondary);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  margin: 4px 0;
  position: relative;
}

#pysuricata-report .correlation-bar .bar-fill {
  height: 100%;
  transition: width 0.3s ease;
  border-radius: 5px;
}

/* Strength-based gradient colors */
#pysuricata-report .correlation-bar .bar-fill.very-strong {
  background: linear-gradient(90deg, #d32f2f 0%, #f44336 100%);
}

#pysuricata-report .correlation-bar .bar-fill.strong {
  background: linear-gradient(90deg, #f57c00 0%, #ff9800 100%);
}

#pysuricata-report .correlation-bar .bar-fill.moderate {
  background: linear-gradient(90deg, #fbc02d 0%, #ffeb3b 100%);
}

#pysuricata-report .correlation-bar .bar-fill.weak {
  background: linear-gradient(90deg, #9e9e9e 0%, #bdbdbd 100%);
}

/* Correlation metadata: strength label and direction */
#pysuricata-report .correlation-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  gap: 1rem;
}

#pysuricata-report .strength-label {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
}

#pysuricata-report .strength-label.very-strong {
  color: #d32f2f;
  background: rgba(211, 47, 47, 0.1);
}

#pysuricata-report .strength-label.strong {
  color: #f57c00;
  background: rgba(245, 124, 0, 0.1);
}

#pysuricata-report .strength-label.moderate {
  color: #fbc02d;
  background: rgba(251, 192, 45, 0.1);
}

#pysuricata-report .strength-label.weak {
  color: #9e9e9e;
  background: rgba(158, 158, 158, 0.1);
}

#pysuricata-report .direction-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}

#pysuricata-report .direction-icon {
  font-size: 1rem;
}

#pysuricata-report .direction-text {
  font-weight: 500;
  color: var(--text-secondary);
}

/* Correlation matrix view (for small datasets) */
#pysuricata-report .correlation-matrix-container {
  overflow-x: auto;
  margin-bottom: 1.5rem;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}

/* Custom scrollbar styling - matching Sample section horizontal scrollbar */
#pysuricata-report .correlation-matrix-container::-webkit-scrollbar {
  height: 10px;
}

#pysuricata-report .correlation-matrix-container::-webkit-scrollbar-track {
  background: var(--scroll-track);
}

#pysuricata-report .correlation-matrix-container::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

#pysuricata-report .correlation-matrix-container::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.45);
}

#pysuricata-report:not(.light) .correlation-matrix-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.45);
}

#pysuricata-report .correlation-matrix {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
}

#pysuricata-report .correlation-matrix th {
  background: var(--bg-secondary);
  padding: 8px;
  font-weight: 600;
  text-align: left;
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
}

#pysuricata-report .correlation-matrix thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  text-align: center;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#pysuricata-report .correlation-matrix tbody th {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#pysuricata-report .correlation-matrix .corr-cell {
  padding: 10px;
  text-align: center;
  border: 1px solid var(--border-color);
  font-family: ui-monospace, monospace;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

#pysuricata-report .correlation-matrix .corr-cell:hover {
  transform: scale(1.05);
  z-index: 5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Matrix cell colors by strength */
#pysuricata-report .correlation-matrix .corr-cell.diagonal {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 500;
  cursor: default;
}

#pysuricata-report .correlation-matrix .corr-cell.very-strong.positive {
  background: rgba(76, 175, 80, 0.9);
  color: white;
}

#pysuricata-report .correlation-matrix .corr-cell.very-strong.negative {
  background: rgba(244, 67, 54, 0.9);
  color: white;
}

#pysuricata-report .correlation-matrix .corr-cell.strong.positive {
  background: rgba(76, 175, 80, 0.6);
  color: white;
}

#pysuricata-report .correlation-matrix .corr-cell.strong.negative {
  background: rgba(244, 67, 54, 0.6);
  color: white;
}

#pysuricata-report .correlation-matrix .corr-cell.moderate.positive {
  background: rgba(76, 175, 80, 0.3);
  color: var(--text-primary);
}

#pysuricata-report .correlation-matrix .corr-cell.moderate.negative {
  background: rgba(244, 67, 54, 0.3);
  color: var(--text-primary);
}

#pysuricata-report .correlation-matrix .corr-cell.weak {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  opacity: 0.6;
}

#pysuricata-report .correlation-matrix .corr-cell.weak .weak-val {
  font-size: 0.75rem;
}

/* No correlations empty state */
#pysuricata-report .no-correlations-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

#pysuricata-report .no-correlations-state .icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
  opacity: 0.5;
}

#pysuricata-report .no-correlations-state p {
  margin: 0;
  font-size: 1rem;
  color: var(--text-secondary);
}

/* Legend styling */
#pysuricata-report .correlations-section-redesign .correlation-legend {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  font-size: 0.875rem;
  flex-wrap: wrap;
}

#pysuricata-report .correlation-legend .legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

#pysuricata-report .correlation-legend .color-box {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

#pysuricata-report:not(.light) .correlation-legend .color-box {
  border-color: rgba(255, 255, 255, 0.2);
}

#pysuricata-report .correlation-legend .color-box.very-strong {
  background: linear-gradient(90deg, #d32f2f 0%, #f44336 100%);
}

#pysuricata-report .correlation-legend .color-box.strong {
  background: linear-gradient(90deg, #f57c00 0%, #ff9800 100%);
}

#pysuricata-report .correlation-legend .color-box.moderate {
  background: linear-gradient(90deg, #fbc02d 0%, #ffeb3b 100%);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #pysuricata-report .correlation-section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  #pysuricata-report .correlation-legend-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  #pysuricata-report .correlation-header {
    flex-direction: column;
    align-items: flex-start;
  }

  #pysuricata-report .col-pair {
    max-width: 100%;
    font-size: 0.85rem;
  }

  #pysuricata-report .correlations-container {
    max-height: 500px;
  }

  #pysuricata-report .correlation-matrix-container {
    font-size: 0.75rem;
  }

  #pysuricata-report .correlation-matrix .corr-cell {
    padding: 6px;
  }
}

/* Bar Chart Styles */
#pysuricata-report .missing-bar-chart {
  padding: 1rem;
}

#pysuricata-report .missing-bar-item {
  display: grid;
  grid-template-columns: 200px 1fr 100px;
  gap: 1rem;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

#pysuricata-report .missing-bar-item:last-child {
  border-bottom: none;
}

#pysuricata-report .missing-var-name {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: inherit;
  display: inline-block;
}



#pysuricata-report:not(.light) .missing-var-name {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}

#pysuricata-report .missing-bar-visual {
  background: var(--bg-secondary);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}



#pysuricata-report:not(.light) .missing-bar-visual {
  background: var(--divider-dark);
}

#pysuricata-report .missing-bar-fill {
  height: 100%;
  transition: width 0.3s ease;
  border-radius: 4px;
}

#pysuricata-report .missing-bar-fill.low {
  background: #22c55e;
}

#pysuricata-report .missing-bar-fill.medium {
  background: #f59e0b;
}

#pysuricata-report .missing-bar-fill.high {
  background: #ef4444;
}

#pysuricata-report .missing-bar-label {
  text-align: right;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Spectrum Styles - reuse existing spectrum CSS */
#pysuricata-report .missing-spectrum-container {
  padding: 1rem;
}

#pysuricata-report .missing-spectrum-item {
  margin-bottom: 1.5rem;
}

#pysuricata-report .missing-spectrum-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
}

#pysuricata-report .missing-spectrum-bar {
  height: 24px;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  border: 1px solid var(--chip-br-light);
}



#pysuricata-report:not(.light) .missing-spectrum-bar {
  border-color: var(--chip-br-dark);
}

#pysuricata-report .spectrum-segment {
  height: 100%;
  cursor: pointer;
  transition: opacity 0.2s;
}

#pysuricata-report .spectrum-segment:hover {
  opacity: 0.8;
}

/* Color classes for spectrum */
#pysuricata-report .spectrum-low {
  background: #22c55e;
}

#pysuricata-report .spectrum-medium {
  background: #f59e0b;
}

#pysuricata-report .spectrum-high {
  background: #ef4444;
}

/* Missing Values Container */
#pysuricata-report .missing-values-container {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--chip-br-light);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 1rem 0;
  transition: background-color .2s ease, transform .12s ease;
}



#pysuricata-report:not(.light) .missing-values-container {
  border-color: var(--chip-br-dark);
  background: rgba(255, 255, 255, 0.04);
}

#pysuricata-report .missing-values-container:hover {
  background: rgba(0, 0, 0, 0.04);
  transform: translateY(-1px);
}

#pysuricata-report:not(.light) .missing-values-container:hover {
  background: rgba(255, 255, 255, 0.06);
}

#pysuricata-report .missing-values-container .missing-section-tabs {
  margin-bottom: 1.5rem;
  padding-bottom: 0;
}

#pysuricata-report .missing-values-container .missing-tab-content {
  margin-top: 0;
}

/* =============================
   Datetime Timeline Chart (Main Line Chart)
   ============================= */

/* Datetime timeline SVG enhancements */
#pysuricata-report .dt-svg .hist-title {
  font-weight: 600;
  fill: var(--text-primary);
}

#pysuricata-report:not(.light) .dt-svg .hist-title {
  fill: #f9f9f9;
}

#pysuricata-report .dt-svg .line {
  stroke: var(--bar);
  stroke-width: 1.5;
  fill: none;
  cursor: pointer;
  transition: stroke-width 0.2s ease, stroke-opacity 0.2s ease;
}

#pysuricata-report .dt-svg .line:hover {
  stroke-width: 2.5;
  stroke-opacity: 0.8;
}

#pysuricata-report .dt-svg .hot {
  cursor: pointer;
  transition: fill 0.2s ease, opacity 0.2s ease;
}

#pysuricata-report .dt-svg .hot:hover {
  fill: var(--bar);
  opacity: 0.15;
}

/* X-axis tick label improvements */
#pysuricata-report .dt-svg .x-tick-label {
  font-size: 11px;
  fill: var(--axis-text);
  max-width: 100px;
  overflow: visible;
  text-overflow: unset;
  white-space: nowrap;
}

@media (max-width: 560px) {
  #pysuricata-report .dt-svg .x-tick-label {
    font-size: 10px;
    transform: rotate(-45deg);
    transform-origin: center;
  }
}

/* Timestamp value display improvements */
#pysuricata-report .var-card__body .triple-row .stats-right table.kv .timestamp-value {
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
  word-break: break-all;
  max-width: none;
  font-size: 0.85rem;
}

/* Chart container overflow handling */
#pysuricata-report .var-card__body .triple-row .chart {
  overflow: hidden;
}

/* =============================
   Temporal Distribution Charts
   ============================= */

/* Statistics section - two tables side by side */
#pysuricata-report .temporal-analysis {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

#pysuricata-report .temporal-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  #pysuricata-report .temporal-analysis {
    flex-direction: row;
    gap: 2rem;
  }

  #pysuricata-report .temporal-section {
    flex: 1;
  }
}

/* Grid layout for temporal charts */
#pysuricata-report .temporal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-top: 1rem;
}

@media (max-width: 768px) {
  #pysuricata-report .temporal-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Individual chart items */
#pysuricata-report .temporal-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#pysuricata-report .temporal-item h4 {
  margin: 0 0 0.25rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

/* SVG chart styling */
#pysuricata-report .temporal-chart {
  width: 100%;
  height: auto;
  display: block;
}

/* Bar styling with smooth transitions */
#pysuricata-report .temporal-chart .bar {
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center bottom;
}

#pysuricata-report .temporal-chart .bar:hover {
  fill: #60a5fa !important;
  fill-opacity: 1 !important;
  stroke: #2563eb !important;
  stroke-width: 1.5 !important;
  filter: drop-shadow(0 4px 8px rgba(59, 130, 246, 0.4));
  transform: scaleY(1.05);
}

/* Enhanced hover effect for better visibility */
#pysuricata-report:not(.light) .temporal-chart .bar:hover {
  filter: drop-shadow(0 4px 12px rgba(96, 165, 250, 0.5));
}

/* Grid lines */
#pysuricata-report .temporal-chart .grid-line {
  stroke-dasharray: 2, 3;
}

/* Axis and tick styling */
#pysuricata-report .temporal-chart .axis {
  stroke-linecap: round;
}

#pysuricata-report .temporal-chart .tick-label,
#pysuricata-report .temporal-chart .x-label {
  user-select: none;
  pointer-events: none;
}

/* Dark mode adjustments */
#pysuricata-report:not(.light) .temporal-chart .grid-line {
  stroke: #4b5563;
  stroke-opacity: 0.3;
}

#pysuricata-report:not(.light) .temporal-chart .axis {
  stroke: #9ca3af;
}

#pysuricata-report:not(.light) .temporal-chart .tick-label,
#pysuricata-report:not(.light) .temporal-chart .x-label {
  fill: #d1d5db;
}

/* Empty chart state */
#pysuricata-report .temporal-chart.empty text {
  font-style: italic;
}

#pysuricata-report:not(.light) .temporal-chart.empty text {
  fill: #6b7280;
}

/* Responsive adjustments */
@media (max-width: 560px) {
  #pysuricata-report .temporal-item .chart-container {
    padding: 0.75rem;
  }

  #pysuricata-report .temporal-chart .x-label {
    font-size: 9px !important;
  }
}

/* =============================
   Description Editor
   ============================= */

/* Description section styling - compact dropdown */
#pysuricata-report .description-value {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  min-height: 1.2rem;
  /* Removed: max-height, overflow constraints for dynamic sizing */
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  transition: all 0.2s ease;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
}

#pysuricata-report .description-value:hover:not(.editing) {
  background: rgba(0, 0, 0, 0.02);
}

#pysuricata-report:not(.light) .description-value:hover:not(.editing) {
  background: rgba(255, 255, 255, 0.04);
}

#pysuricata-report .description-value:empty::before {
  content: "Click to add description...";
  color: var(--text-muted);
  font-style: italic;
}

/* Edit mode */
#pysuricata-report .description-value.editing {
  border-color: var(--bar);
  background: var(--bg-secondary);
  cursor: text;
}

#pysuricata-report .description-content {
  margin: 0;
}


#pysuricata-report .description-content .placeholder {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.85rem;
}

/* Textarea editor */
#pysuricata-report .description-editor {
  width: 100%;
  min-height: 60px;
  /* Removed: max-height, overflow constraints for dynamic sizing */
  padding: 0.5rem;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 2px solid var(--bar);
  border-radius: 4px;
  outline: none;
  resize: none;
  /* Disable manual resize */
  overflow: hidden;
  /* Hide overflow instead of scrolling */
  height: auto;
  /* Let it grow with content */
}

#pysuricata-report .description-editor:focus {
  border-color: var(--bar);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Fix padding for summary description textarea only */
#pysuricata-report #summary-description .description-editor {
  padding: 0;
}

/* Scrollbar styling removed - no longer needed with dynamic sizing */

/* Markdown rendering */
#pysuricata-report .description-content h1,
#pysuricata-report .description-content h2,
#pysuricata-report .description-content h3 {
  margin-top: 0;
  margin-bottom: 0.2em;
  font-weight: 600;
}

#pysuricata-report .description-content h1 {
  font-size: 1.4em;
}

#pysuricata-report .description-content h2 {
  font-size: 1.2em;
}

#pysuricata-report .description-content h3 {
  font-size: 1.1em;
}

#pysuricata-report .description-content ul {
  margin: 0.2em 0;
  padding-left: 1.5em;
}

#pysuricata-report .description-content li {
  margin: 0.1em 0;
}

#pysuricata-report .description-content strong {
  font-weight: 600;
}

#pysuricata-report .description-content em {
  font-style: italic;
}
