.top-header {
  width: 100%;
  position: sticky;
  top: 0px;
  z-index: 10;
}

/* Sidebar Setup */
.side-navbar {
  /* Set the initial width */
  width: 60px;
  /* Make the sidebar float above other content */
  position: fixed;
  /* Anchor it to the left side */
  left: 0;
  /* Ensure it is above the main content */
  z-index: 100;
  /* Add a transition for smooth expansion */
  transition: width 0.1s ease-in-out;
  /* Set maximum height to fill the screen */
  height: 100vh;
  box-shadow: var(--bs-border-width) 0 6px 1px #2b509a;
}


/* Hover Effect */
.side-navbar:hover {
  /* Expand the width */
  width: 250px;
  transition-delay: 0.5s;
}

.side-navbar .full-logo {
  width: 31px;
  display: flex;
  overflow-x: hidden;
  transition-delay: 0s;
  transition-duration: 0s;
}

.side-navbar:hover .full-logo {
  width: 137px;
  transition-property: width;
  transition-duration: 0.1s;
  /* The duration of the actual width change (0px to 156px) */
  /* CRITICAL: Add the 0.5s delay here! */
  transition-delay: 0.5s;
}

.main-content {
  flex: 0 0 auto;
  width: calc(100% - 60px);
  margin-left: 60px;
  position: fixed;
}

@media (max-width: 767.98px) {
  .main-content {
    width: 100%;
    margin-left: 0px;
    position: unset;
  }

  .top-header {
    position: unset;
  }

  .side-navbar {
    width: 100% !important;
    position: unset;
    height: fit-content;
    z-index: unset;
    transition: unset;
    box-shadow: none;
  }

  .side-navbar .nav-tooltip {
    width: 100%;
  }

  .side-navbar .tooltip-text {
    width: 160px !important;
  }

  .side-navbar .small-logo {
    display: none !important;
    /* Show the small logo by default */
  }

  .side-navbar .full-logo {
    display: none !important;
    /* Hide the full logo by default */
  }
}

/* Base styles for the hamburger button (visible only below 768px) */
.navbar-toggler {
  /* Position the button at the top/left for a clean look */
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1000;
  /* Ensure it's above other content */
}

/* Desktop styles (768px and up) */
@media (min-width: 768px) {

  /* Hide the hamburger button on desktop */
  .navbar-toggler {
    display: none;
  }

  /* Ensure the sidebar is fixed and full height on desktop */
  .side-navbar {
    position: fixed;
    width: 60px;
    /* or whatever your collapsed width is */
    height: 100vh;
  }
}

.nav-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-size: 14px !important;
  list-style: none;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  text-decoration: none;
  color: white;
  white-space: nowrap;
  border-left: 4px solid transparent;
  padding-left: 1rem;
  justify-content: start;
}

.nav-tooltip:not(.header-active):hover {
  background-color: var(--bg-secondary-bg);
}

.header-active {
  border-left: 4px solid #3b6fff !important;
  background: rgba(35, 96, 154, 0.7);
  color: #f8dd6c;
}

.nav-tooltip i {
  font-size: 22px !important;
}

.nav-tooltip .material-icons {
  font-size: 24px;
}

.side-navbar .tooltip-text {
  /* Initial hidden state */
  margin-left: 0.5rem;
  /* Add a transition for opacity (the fade effect) */
  /* CRITICAL: Add the delay here. The transition to visible/opacity: 1
     will wait 0.3s before starting. */
  width: 0px;
  padding-bottom: 2px;

  transition-delay: 0s;
}

/* Hover state (Appearance after delay) */
.side-navbar:hover .tooltip-text {
  /* These changes will be delayed by the transition-delay property above */
  width: 160px;

  transition-property: width;
  transition-duration: 0.1s;
  /* The duration of the actual width change (0px to 156px) */

  /* CRITICAL: Add the 0.5s delay here! */
  transition-delay: 0.5s;
}

.button-ghost {
  color: #f7f6f3;
  border: none;
  padding-top: 0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  padding-bottom: 0.5rem;
  text-decoration: underline;
  text-underline-offset: 6px;
  background-color: transparent;
  border-radius: 4px;
}

.button-ghost:disabled {
  color: #77a1b5;
  cursor: not-allowed;
}

.button-ghost:hover {
  background: #2b509a;
  color: #f7f6f3;
}

.button-ghost:disabled:hover {
  color: #77a1b5;
  cursor: not-allowed;
  background: transparent;
}

.button-ghost i {
  text-decoration: underline;
}

.button-ghost.icon i {
  text-decoration: none !important;
}

.button-primary {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #f0c808;
  color: #0f2a43;
  font-weight: bold;
  border-radius: 4px;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  border: 0px;
}

.button-primary:hover {
  background: #23609a;
  color: #f7f6f3;
}

.button-primary:disabled {
  color: hsl(54, 16%, 35%);
  cursor: not-allowed;
  background: #f0c808;
}

.button-primary:disabled:hover {
  color: hsl(54, 16%, 35%);
  cursor: not-allowed;
  background: #f0c808;
}

.button-danger {
  background: var(--bs-danger-bg-subtle);
  color: var(--bs-body-color);
  border: var(--bs-border-width) var(--bs-border-style) var(--bs-danger);
  padding-top: 0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  padding-bottom: 0.5rem;
  border-radius: 4px;
}

.button-danger:hover {
  background: var(--bs-danger);
  color: #f7f6f3;
}

.button-danger:disabled {
  color: var(--bs-secondary-color);
  cursor: not-allowed;
  background: var(--bs-danger-bg-subtle);
  opacity: 0.5;
}

.button-danger:disabled:hover {
  color: var(--bs-secondary-color);
  cursor: not-allowed;
  background: var(--bs-danger-bg-subtle);
}

.button-small {
  font-size: smaller;
  padding: 0.25rem !important;
}

.button-larger {
  font-size: larger;
  padding: 0.75rem !important;
}

.button-large {
  font-size: large;
  padding: 1rem !important;
}

.button-secondary {
  display: flex;
  padding: 0.5rem;
  background: #163755;
  justify-content: center;
  align-items: center;
  border: 1px solid #2b509a;
  border-radius: 4px;
  width: fit-content;
  height: fit-content;
  text-align: center;
}

.button-secondary:disabled {
  color: #77a1b5;
  cursor: not-allowed;
}

.button-secondary:hover {
  background: #2b509a;
  color: #f7f6f3;
}

.button-secondary:disabled:hover {
  color: #77a1b5;
  background: #163755;
  cursor: not-allowed !important;
}

.text-toggle {
  border-radius: 4px;
  overflow: hidden;
}

.text-toggle-element {
  display: flex;
  text-align: center;
  align-items: center;
  color: #77a1b5;
  background-color: #163755;
  border-radius: 0;
}

.text-toggle-element:hover {
  cursor: pointer;
  background-color: #2b509a;
}

.text-toggle-element.active {
  background-color: #031633;
  color: #f7f6f3;
}

.text-toggle .text-toggle-element:first-child {
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

.text-toggle .text-toggle-element:last-child {
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

#threat_actor_profiles tr.threat-profile-row-clickable {
  cursor: pointer;
}

#threat_actor_profiles a.threat-profile-row-link {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 2rem;
  color: inherit;
  text-decoration: none;
}

#threat_actor_profiles a.threat-profile-row-link .threat-profile-table-cell-inner,
#threat_actor_profiles a.threat-profile-row-link.threat-profile-table-cell-inner {
  min-height: 2rem;
  width: 100%;
}

#threat_actor_profiles a.threat-profile-row-link .ellipses-overflow,
#threat_actor_profiles a.threat-profile-row-link.ellipses-overflow {
  display: block;
  line-height: 2rem;
}

#threat_actor_profiles .threat-profile-card,
#threat_actor_profiles .threat-profile-card-body-link,
#threat_actor_profiles .threat-profile-card-chart-row {
  min-height: 0;
}

#threat_actor_profiles .threat-profile-card-activity,
#threat_actor_profiles .indicator-activity-chart-mini {
  overflow: visible;
  min-height: 48px;
}

#threat_actor_profiles .threat-profile-card-activity {
  height: 100%;
  display: flex;
  flex-direction: column;
}

#threat_actor_profiles .indicator-activity-chart-mini {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

#threat_actor_profiles .threat-profile-card-activity svg,
#threat_actor_profiles .indicator-activity-chart-mini svg {
  max-width: 100%;
  height: 100%;
}

#threat_actor_detailed #indicator-activity-chart {
  height: 360px;
  max-height: 360px;
  overflow: visible;
}

#threat_actor_detailed #indicator-activity-chart .indicator-activity-chart-container {
  height: 100%;
}

#threat_actor_detailed #indicator-activity-chart svg {
  max-width: 100%;
  height: 100%;
}

#threat_actor_profiles .threat-profile-card-wrapper {
  cursor: pointer;
}

#threat_actor_profiles a.threat-profile-card-header-link,
#threat_actor_profiles a.threat-profile-card-body-link,
#threat_actor_profiles a.threat-profile-card-header-link:hover,
#threat_actor_profiles a.threat-profile-card-body-link:hover {
  color: inherit;
}

.threat-badge {
  border: var(--bs-border-width) var(--bs-border-style) transparent;
  border-radius: 0;
  background-color: transparent;
  color: #fff;
  display: inline-flex;
}

.threat-badge-malware {
  border-color: #de1b58;
}

.threat-badge-malware > i {
  color: #de1b58;
}

.threat-badge-malicious {
  border-color: #ff8a24;
}

.threat-badge-malicious > i {
  color: #ff8a24;
}

.threat-badge-suspicious {
  border-color: #f0c808;
}

.threat-badge-suspicious > i {
  color: #f0c808;
}

.threat-badge-info {
  border-color: var(--bs-border-color);
}

#threat_actor_profiles .threat-profile-card-indicators {
  position: relative;
  z-index: 1;
}

#threat_actor_profiles .threat-profile-table-cell-inner {
  min-height: 2rem;
  display: flex;
  align-items: center;
}

#threat_actor_profiles .threat-profile-table-cell-inner.ellipses-overflow {
  display: block;
  line-height: 2rem;
}

.port-box {
  padding: 0.25rem;
  font-size: small;
  background: #3b6fff;
  border-radius: 4px;
  display: flex;
  align-items: center;
  text-align: center;
}

.text-large {
  font-size: larger;
}


/* Container to manage the relative positioning of the tabs and arrows */
.tab-scroll-wrapper {
  position: relative;
  /* Adjust width as needed, but it must be narrower than the content inside tabs-container for overflow to occur */
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
}

/* The actual scrollable tabs container */
.tabs-container {
  /* You can change this to 'scroll' if you want the scrollbar always visible */
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  /* Keeps tabs on a single line */
  padding: 0 5px;
  /* Hides the default scrollbar for a cleaner look */
  -ms-overflow-style: none;
  /* IE and Edge */
  scrollbar-width: none;
  /* Firefox */
  /* Remove scrollbar for Chrome/Safari/Opera */
}

.tabs-container::-webkit-scrollbar {
  display: none;
}

/* --- CHANGES TO SCROLL ARROW STYLING --- */
.scroll-arrow {
  position: sticky;
  flex-shrink: 0;
  /* Prevents the arrows from shrinking when space is tight */

  height: 100%;
  width: 30px;
  z-index: 10;
  border: none;
  cursor: pointer;
  background: #0b1f32;
  font-size: 1.5em;
  border-top: 1px solid #2b509a;
  color: #f7f6f3;
  transition: opacity 0.3s;
}

.scroll-arrow:disabled {
  opacity: 0.7;
  color: #77a1b5;
  cursor: not-allowed;
}

.scroll-arrow:hover:not(:disabled) {
  background-color: rgba(59, 111, 255, 0.7);
}

.scroll-arrow.hidden {
  display: none;
}

/* --- Positioning the arrows (Using `left: 0` and `right: 0` for sticky positioning) --- */
.left-arrow {
  left: 0;
  /* Sticks to the left edge of the parent */
  box-shadow: 5px 0 5px -5px rgba(0, 0, 0, 0.2);
  border-right: 1px solid #2b509a;
}

.right-arrow {
  right: 0;
  /* Sticks to the right edge of the parent */
  box-shadow: -5px 0 5px -5px rgba(0, 0, 0, 0.2);
  margin-left: auto !important;
  border-left: 1px solid #2b509a;
}

.underline-btn {
  cursor: pointer;
  border: none;
  font-family: 'autovia-bold';
  font-size: 1rem;
  background: transparent;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  border-radius: 4px;
  position: relative;
  margin-bottom: 0.25rem;
}

.underline-btn:not(.underline-btn-active):not([disabled]):hover {
  background-color: rgba(59, 111, 255, 0.5);
}

.underline-btn[disabled] {
  cursor: not-allowed;
  opacity: 0.8;
  /* optional visual cue */
}

.underline-btn span.loading {
  background-color: transparent !important;
}

.underline-btn span:not(:empty) {
  margin-left: 3px;
  background-color: rgba(3, 16, 51, 1);
  padding: 2px 6px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
}

.underline-btn-active::after {
  content: '';
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: -0.25rem;
  height: 4px;
  background-color: #3b6fff;
}

.verdict {
  font-family: 'autovia-bold';
}

.skeleton {
  display: flex;
  align-items: center;
  padding: 16px;
  border-radius: 8px;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #77a1b5;
  margin-right: 16px;
  position: relative;
  overflow: hidden;
}

.skeleton-lines {
  flex: 1;
}

.skeleton-line {
  height: 10px;
  border-radius: 4px;
  background: #77a1b5;
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;
}

.skeleton-line.short {
  width: 70%;
}

.skeleton-line.shorter {
  width: 50%;
}

.skeleton-avatar::after,
.skeleton-line::after {
  content: "";
  position: absolute;
  top: 0;
  left: -150px;
  height: 100%;
  width: 150px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 4.0s infinite;
}

@keyframes shimmer {
  100% {
    transform: translateX(600px);
  }
}

/* Fixed color for delimiters (should match the background or be very light) */
.hl-delimiter {
  color: #FFFFFF;
  /* Set to white or transparent if the background is white */
}

/* Phase classes based on your API return values: key, operator, operand, value */
.hl-key {
  color: #8C6CE2;
  /* Purple/Blue */
  font-weight: bold;
}

.hl-operator {
  color: #FF0000;
  /* Red */
}

.hl-value,
.hl-operand {
  color: #008000;
  /* Green */
}

.hl-default {
  color: #333333;
  /* Standard dark text */
}

.w-sm-100 {}


@media (max-width: 767.98px) {
  .w-sm-100 {
    width: 100% !important;
  }
}

.breadcrumbs {
  font-weight: 500;
  font-size: 14px;
}

.pb-2px {
  padding-bottom: 2px;
}

.query-error {
  /* Apply the standard wavy underline */
  text-decoration: underline wavy red 1px;
  /* Important for contenteditable: 
     Ensure user can still click/edit through this span */
  pointer-events: none; 
}

.mb-2px {
  margin-bottom: 2px;
}

/* Container for the Grid */
.heatmap-grid {
  display: grid;
  /* 7 columns for 7 days (Mon-Sun or Sun-Sat) */
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  border-radius: 4px;
}

/* Individual Cell Styling */
.heatmap-cell {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 3px;
  transition: background-color 0.2s;
  user-select: none;
  border: 1px solid rgb(35, 96, 154);
  /* Prevent highlighting on double-click */
}

.heatmap-cell:hover {
  box-shadow: 0 0 0 2px #007bff inset;
}

.heatmap-cell.empty {
  border: none;
  pointer-events: none;
  cursor: default;
}

/* Heatmap Color Levels - Linear gradient based on primary blue (#3B6FFF / hsl(224, 100%, 62%)) */
/* Progression: Lightness increases linearly from 15% to 85% (steps of ~14%) */
/*              Saturation increases from 30% to 100% (steps of ~14%) */

.heatmap-cell.level-0 {
  background-color: hsl(209, 63%, 16%);
  color: white;
}

.heatmap-cell.level-1 {
  background-color: hsl(224, 85%, 42%);
  color: white;
}

.heatmap-cell.level-2 {
  background-color: hsl(224, 95%, 56%);
  color: white;
}

.heatmap-cell.level-3 {
  background-color: hsl(224, 100%, 70%);
  color: hsl(224, 100%, 15%);
}

.heatmap-cell.level-4 {
  background-color: hsl(224, 100%, 85%);
  color: hsl(224, 100%, 15%);
}

.heatmap-cell.level-5 {
  background-color: hsl(225, 100%, 91%);
  color: hsl(224, 100%, 15%);
}

/* Styling for the selected date */
.heatmap-cell.active {
  border: 3px solid #007bff;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

/* Calendar Header Styling */
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

/* Day Names (Optional: Add above heatmap-grid for full calendar look) */
.day-names {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  width: 300px;
  text-align: center;
  font-size: 0.8em;
  color: #555;
  margin-bottom: 5px;
}

/* Day-of-week headers for heatmap calendar */
.heatmap-day-headers {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 5px;
}

.heatmap-day-header {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #6c757d;
  text-align: center;
  user-select: none;
  font-weight: bold;
}

/* ── Pivot History ──────────────────────────────────────────────── */
.ph-chip i.fa-copy {
  margin-left: 6px;
}

/* type badge base */
.ph-badge {
  height: 22px;
  width: 22px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.ph-badge-sm { height: 20px !important; width: 20px !important; font-size: 9px !important; }
.ph-badge-xs { height: 16px !important; width: 16px !important; font-size: 8px !important; }

/* type colours */
.ph-badge-d { border: 1px solid; color: #e2e8f0; background-color: #1e293b; border-color: #94a3b8; }
.ph-badge-i { border: 1px solid; color: #fde68a; background-color: #1e293b; border-color: #f59e0b; }
.ph-badge-h { border: 1px solid; color: #fed7aa; background-color: #1e293b; border-color: #f97316; }
.ph-badge-s { border: 1px solid; color: #bae6fd; background-color: #1e293b; border-color: #38bdf8; }
.ph-badge-a { border: 1px solid; color: #d1fae5; background-color: #1e293b; border-color: #6ee7b7; }
.ph-badge-l { border: 1px solid; color: #ede9fe; background-color: #1e293b; border-color: #a78bfa; }

/* tree structure */
.ph-tree-row { position: relative; min-height: 32px; transition: opacity 0.15s ease; }
.ph-tree-vline {
  position: absolute; top: 0; bottom: 0; width: 1px;
  background: rgba(255,255,255,0.09);
  pointer-events: none;
}
.ph-tree-elbow {
  position: absolute; width: 10px; height: 50%; top: 0;
  border-left: 1px solid rgba(255,255,255,0.14);
  border-bottom: 1px solid rgba(255,255,255,0.14);
  border-bottom-left-radius: 3px;
}
.ph-tree-elbow-ext {
  position: absolute; width: 1px;
  background: rgba(255,255,255,0.14);
}

/* chip base + states */
.ph-chip-base { background: #0d2440; border: 1px solid rgba(255,255,255,0.2); padding: 4px 8px; cursor: pointer; }
/* provenance row base */
.ph-chip {
  transition: background 0.12s ease, border-color 0.12s ease;
}
.ph-chip:hover {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.22) !important;
}
.ph-chip.ph-chip-current { border: 2px dashed #f0c808 !important; background: rgba(240,200,8,0.06) !important; }
.ph-chip.ph-chip-current:hover { background: rgba(240,200,8,0.14) !important; border-color: rgba(240,200,8,0.55) !important; }
.ph-chip.ph-chip-multi { border-color: rgba(252,211,77,0.35) !important; background: rgba(252,211,77,0.04) !important; }

/* provenance rows */
.ph-row-base { background: #0d2440; border: 1px solid rgba(255,255,255,0.2); }
.ph-row {
  transition: background 0.1s ease, border-color 0.1s ease;
}
.ph-row:hover {
  background: rgba(255,255,255,0.04) !important;
  border-color: rgba(255,255,255,0.18) !important;
}
.ph-row.ph-row-current { background: rgba(240,200,8,0.06) !important; border: 2px dashed #f0c808 !important; }
.ph-row.ph-row-current:hover { background: rgba(240,200,8,0.1) !important; border-color: rgba(240,200,8,0.55) !important; }
.ph-row-related-current { background: rgba(240,200,8,0.08); border: 1px solid rgba(240,200,8,0.35); }
.ph-row.ph-row-related-current:hover { border-color: rgba(240,200,8,0.55) !important; }

/* path chips */
.ph-path-chip-base { background: #0d2440; border: 1px solid rgba(255,255,255,0.2); padding: 3px 6px; cursor: pointer; }
.ph-path-chip {
  transition: background 0.12s ease, border-color 0.12s ease;
}
.ph-path-chip:hover {
  background: rgba(255,255,255,0.07) !important;
  border-color: rgba(255,255,255,0.22) !important;
}
.ph-path-chip.ph-path-chip-current { background: rgba(240,200,8,0.12) !important; border: 1px solid rgba(240,200,8,0.4) !important; }
.ph-path-chip.ph-path-chip-current:hover {
  background: rgba(240,200,8,0.2) !important;
  border-color: rgba(240,200,8,0.6) !important;
}

/* dup badge */
.ph-dup-badge {
  background: #031033;
  color: #f7f6f3;
  font-weight: 700;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 10px;
  font-family: ui-monospace, monospace;
  flex-shrink: 0;
}

/* depth number & timestamp in provenance rows */
.ph-depth-num {
  width: 28px; text-align: right; flex-shrink: 0;
  font-family: ui-monospace, monospace; font-size: 11px;
  color: rgba(255,255,255,0.3);
}
.ph-row-time { white-space: nowrap; flex-shrink: 0; font-size: 11px; color: rgba(255,255,255,0.35); }

/* legend swatch for current node */
.ph-legend-current { height: 22px; width: 22px; border: 2px dashed #f0c808; background: rgba(240,200,8,0.06); }

/* ── Detail / advanced / lookalikes top action bar ───────────────── */
.topbar {
  align-items: center;
  min-height: 52px;
  padding: 6px 4px;
  /* Scroll horizontally as a single toolbar instead of wrapping onto
     multiple lines whenever the items don't fit the available width. */
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}

.topbar::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.topbar > .col-auto,
.topbar > a.col-auto {
  flex: 0 0 auto;
}

/* Action items (Add to project, Lookalike Search, Live Scan, …) are the
   items carrying a `b-r` separator in markup. Restyle them to match the
   app's `.button-secondary` — a filled button so they read as buttons,
   without the nested-outline look. */
.topbar > .col-auto.b-r,
.topbar > a.col-auto.b-r {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0 0.2rem;
  padding: 0.4rem 0.8rem !important;
  background: #163755;
  border: 1px solid #2b509a !important;
  border-radius: 4px;
  font-size: 0.9rem;
  color: var(--bs-body-color);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.12s ease, color 0.12s ease;
}

/* Enabled buttons: pointer + filled hover (matches .button-secondary) */
.topbar > .col-auto.b-r:not(.inactive),
.topbar > a.col-auto.b-r:not(.inactive) {
  cursor: pointer;
}

.topbar > .col-auto.b-r:not(.inactive):hover,
.topbar > a.col-auto.b-r:not(.inactive):hover {
  background: #2b509a;
  color: #f7f6f3;
}

.topbar .material-icons {
  font-size: 19px;
  transition: color 0.12s ease;
}

.topbar .col-auto.b-r .fas {
  font-size: 19px;
  line-height: 1;
  transition: color 0.12s ease;
}

/* Keep the label text tidy */
.topbar [name="description"] {
  white-space: nowrap;
}

/* Bulk-search indicator count badge — balanced padding + accent color */
.bulk-superscript-icon {
  background-color: #f0c808;
  color: #0f2a43;
  padding: 1px 6px;
  font-size: x-small;
  font-weight: 700;
  line-height: 1.4;
  border-radius: 10px;
}

/* Right-aligned cluster: session pill + bookmark.
   Kept as a single flex item so the two never split across a wrap. */
.topbar .session-bookmark-cluster {
  flex-wrap: nowrap;
}

.topbar #session-picker-mount {
  padding-right: 0.75rem;
}

.topbar .bookmark-div {
  padding-left: 0.25rem;
  padding-right: 0.5rem;
}

/* Mobile: let the cluster flow inline after the buttons (rather than being
   pushed to a far-right edge by the auto margin) and shrink the pill. */
@media (max-width: 767.98px) {
  .topbar .session-bookmark-cluster {
    margin-left: 0.2rem !important;
  }
  .session-pill {
    max-width: 150px;
  }
}

.bookmark {
  font-size: 18px;
  cursor: pointer;
  transition: color 0.12s ease;
}

.bookmark:hover {
  color: #f0c808 !important;
}

/* ── Session picker pill ─────────────────────────────────────────── */
.session-pill {
  background: #0d2440;
  border: 1px solid var(--bg-separator);
  border-radius: 6px;
  padding: 0.34rem 0.7rem;
  max-width: 200px;
  white-space: nowrap;
  cursor: pointer;
  color: #cdddf2;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.session-pill:hover {
  border-color: #3b6fff;
  background: #123150;
}

.session-pill-active {
  border-color: #f0c808;
}

.session-pill-icon {
  font-size: 11px;
  color: #89a8ff;
  flex-shrink: 0;
}

.session-pill-active .session-pill-icon {
  color: #f0c808;
}

.session-pill-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-pill-caret {
  font-size: 10px;
  opacity: 0.6;
  flex-shrink: 0;
}

.session-pill-dot {
  font-size: 8px;
  color: #4ade80;
  flex-shrink: 0;
}

.session-row {
  transition: background 0.1s ease;
}
.session-row:hover {
  background: rgba(255,255,255,0.05) !important;
}

/* Active search-filter pills — match the filter popover styling */
#search-filters .filter-chip {
  display: inline-flex;
  /* Override Bootstrap's `.row > *` width:100% so the pill hugs its content */
  width: auto;
  max-width: 100%;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.34rem 0.85rem;
  background-color: #23609a;
  border: 1px solid #3b6fff;
  border-radius: 999px;
  color: #ffffff;
  font-weight: 500;
  line-height: 1.2;
}

.filter-chip .filter-chip-label {
  white-space: nowrap;
}

.filter-chip .filter-chip-x {
  cursor: pointer;
  color: #cfe0f5;
  font-size: 0.9em;
  transition: color 0.12s ease;
}

.filter-chip .filter-chip-x:hover {
  color: #ffd2d2;
}

/* Filter toggle icon + pivot-history icon — highlight when their popup is open */
#qdropstate,
#search_history {
  transition: color 0.15s ease, background-color 0.15s ease;
  border-radius: 4px;
  padding: 0.25rem 0.4rem;
}

#qdropstate.filter-active,
#search_history.filter-active {
  color: #f0c808;
  background-color: rgba(240, 200, 8, 0.15);
}

/* Detail page search/filter popover */
.search-popover {
  position: absolute;
  right: 11rem;
  left: auto;
  z-index: 1;
  border: 1px solid var(--bg-separator);
  border-radius: 10px;
  padding: 2rem 2.25rem;
  width: min(1000px, 95vw);
  background: linear-gradient(180deg, #123150 0%, var(--bs-bg-unselected) 55%);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

.filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem 3rem;
  width: 100%;
}

@media (max-width: 767.98px) {
  .filter-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
}

.filter-col {
  min-width: 0;
}

/* Full-width section (DNS association type + actions) */
.filter-col-full {
  grid-column: 1 / -1;
}

/* Section headers — light-blue accent to establish hierarchy */
.filter-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #89a8ff;
  margin: 0 0 1.1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--bg-separator);
}

/* Labeled input addons — dark-blue prefix chips */
.filter-input-group {
  flex-wrap: nowrap;
}

.filter-addon {
  min-width: 104px;
  font-size: small;
  font-weight: 600;
  color: #cdddf2;
  background-color: #163755;
  border-color: var(--bg-separator);
}

#range_filter_list .form-control {
  background-color: #0c2138;
  border-color: var(--bg-separator);
}

#range_filter_list .form-control:focus {
  border-color: #3b6fff;
  box-shadow: 0 0 0 0.15rem rgba(59, 111, 255, 0.25);
}

/* Keep the jQuery UI datepicker trigger inline and matching the input height */
.filter-date-group .ui-datepicker-trigger {
  flex: 0 0 auto;
  align-self: stretch;
  height: auto;
  margin-left: 0.4rem;
  padding: 0 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background-color: #163755;
  border: 1px solid var(--bg-separator);
  border-radius: 0.2rem;
  box-sizing: border-box;
}

.filter-date-group .ui-datepicker-trigger img {
  height: 1rem;
  width: auto;
  display: block;
}

/* Fallback when the datepicker renders the trigger as a bare image */
.filter-date-group img.ui-datepicker-trigger {
  flex: 0 0 auto;
  align-self: stretch;
  height: auto;
  margin-left: 0.4rem;
  padding: 0.25rem;
  box-sizing: border-box;
  background-color: #163755;
  border: 1px solid var(--bg-separator);
  border-radius: 0.2rem;
  cursor: pointer;
}

/* Association type — flowing pill selector that matches the app's toggles */
#assoc_type .row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
}

#assoc_type .list-group-item {
  width: auto;
  flex: 0 0 auto;
  background: transparent;
  border: 0;
  padding: 0;
}

/* Hide the raw checkbox; the label becomes a clickable pill */
#assoc_type .form-check-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  pointer-events: none;
}

#assoc_type label {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0.32rem 0.8rem;
  border: 1px solid var(--bg-separator);
  border-radius: 999px;
  background-color: #0c2138;
  color: #9fb6d4;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

#assoc_type label:hover {
  background-color: #1c4061;
  color: #e8f0fa;
}

#assoc_type .form-check-input:checked + label {
  background-color: #23609a;
  border-color: #3b6fff;
  color: #ffffff;
}

/* Select-All pill — visually distinct from the type pills */
#assoc_type #select_all + label {
  background-color: transparent;
  border: 1px dashed #89a8ff;
  color: #89a8ff;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 0.35rem;
}

#assoc_type #select_all + label:hover {
  background-color: rgba(137, 168, 255, 0.12);
  color: #cdddf2;
}

#assoc_type #select_all:checked + label {
  background-color: #3b6fff;
  border: 1px solid #3b6fff;
  color: #ffffff;
}

/* Theme the remaining real checkboxes to match the accent blue */
.filter-check {
  accent-color: #3b6fff;
}

/* Divider between Override Type and the search options */
.filter-divider {
  border: 0;
  border-top: 1px solid var(--bg-separator);
  opacity: 1;
  margin: 1rem 0;
}

/* Key Type selector — segmented toggle matching the rest of the app */
.filter-type-toggle {
  border-radius: 6px;
  overflow: hidden;
}

.filter-type-toggle .text-toggle-element {
  padding: 0.55rem 0.5rem;
  font-size: 0.92rem;
  border-right: 1px solid var(--bg-separator);
}

.filter-type-toggle .text-toggle-element:last-of-type {
  border-right: 0;
}

/* Drive the active state off the hidden radio's checked state */
.filter-type-toggle .btn-check:checked + .text-toggle-element {
  background-color: #031633;
  color: #f7f6f3;
  font-weight: 600;
  box-shadow: inset 0 -2px 0 #3b6fff;
}

.filter-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.25rem;
  padding-top: 1.25rem;
  border-top: 2px solid var(--bg-separator);
}

.filter-actions .button-primary {
  min-width: 140px;
}
