/* Column visibility + column filter dropdowns */

/* The popover is a flex column so a search header can stay PINNED while the
   option list below it scrolls. `max-height` is set inline by
   components/dropdown.js from the space actually available under (or over)
   the anchor — it must not be a fixed value here, or a short list gets a
   pointless scrollbar and a tall one still spills.

   It used to have no max-height at all. With `position: fixed` that meant a
   35-option list (Controls > DB Types, ~1014px) hung ~950px below the fold
   with no way to scroll to it — the page slid underneath and those options
   were unreachable. */
.col-picker-dropdown {
  position: fixed;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 16px var(--shadow);
  min-width: 150px;
  overflow: hidden;              /* the BODY scrolls, not the shell */
}

.col-picker-body {
  flex: 1 1 auto;
  min-height: 0;                 /* or the flex child refuses to shrink */
  overflow-y: auto;
  overscroll-behavior: contain;  /* don't chain the scroll to the page */
  padding: 0.35rem 0;
}

/* Pinned above the scroll container so it stays reachable however far down
   the list you are — which is the entire point of having it. */
.col-picker-search {
  flex: 0 0 auto;
  padding: 0.4rem 0.45rem;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
}
.col-picker-search-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 0.8rem;
  padding: 0.25rem 0.45rem;
}
.col-picker-search-input::placeholder { color: var(--dim); }

.col-picker-empty {
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: var(--dim);
  font-style: italic;
}

.col-picker-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.75rem;
  font-size: 0.82rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.1s;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
.col-picker-item:hover { background: var(--lift); }
.col-picker-item input[type="checkbox"] { cursor: pointer; accent-color: var(--accent); }

.col-picker-sep { height: 1px; background: var(--border); margin: 3px 0; }
.col-picker-all { font-style: italic; }

/* Hierarchical picker — db_type parents with their service children
   indented underneath. Used by the DB Types column-header filter on
   the Controls page. */
.col-picker-group {
  padding: 0.15rem 0;
}
.col-picker-parent {
  /* Parent rows look slightly heavier than the flat-list items. */
  padding: 0.3rem 0.75rem;
}
.col-picker-parent strong {
  font-weight: 600;
  letter-spacing: 0.01em;
}
.col-picker-child {
  /* Indented children — service names under their parent db_type. */
  padding: 0.2rem 0.75rem 0.2rem 1.85rem;
  font-size: 0.78rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted);
}
.col-picker-child:hover {
  color: var(--text);
}
