/* ─────────────────────────────────────────────────────────────────────
   32‑px tall action buttons & switches
   (✓ works with any prefix: eg “price‑metric‑aip‑btn”, “atc‑offcanvas‑open”…)
   ───────────────────────────────────────────────────────────────────── */
[id$="-aip-btn"],
[id$="-aup-btn"],
[id$="-adv-toggle-btn"],
[id$="-offcanvas-open"],
[id$="-advanced-date-offcanvas-open"] {
    height: 32px !important;
    min-height: 32px !important;      /* guard against Bootstrap overrides  */
    line-height: 30px !important;     /* keeps the label vertically centred */
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* The “Off‑Market” toggle is a Checklist, not a <button>,
   so we style both the wrapper and the <input> inside it. */
[id$="-offmarket-switch"],
[id$="-offmarket-switch"] .form-check-input {
    height: 32px !important;
    min-height: 32px !important;
}

/* If the element itself is the <button> (most cases) this will suffice.
   But if you ever nest a .btn *inside* the wrapper, clamp that too. */
[id$="-aip-btn"] .btn,
[id$="-aup-btn"] .btn,
[id$="-adv-toggle-btn"].btn,
[id$="-offcanvas-open"].btn,
[id$="-advanced-date-offcanvas-open"].btn {
    height: 32px !important;
    line-height: 30px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}
.filter-label,
.filter-button,
.clear-filters,
.metric-label-btn,
#adv-toggle-btn,
[id$="-label"],          /* off‑market toggle label, etc.            */
[id$="-background"],     /* off‑market toggle bg cell                */
[id$="-offcanvas-open"]  /* covers all prefix-offcanvas-open buttons */
{
    height: 32px !important;
    min-height: 32px !important;
    line-height: 30px !important;   /* keeps text vertically centred   */
    padding-top: 0 !important;      /* trims extra space               */
    padding-bottom: 0 !important;
}

/* If the wrapper (InputGroup) itself was fixed at 39 px: */
.offmarket-toggle-container,
.filter-switch,
.input-group[style*="height: 39px"] {
    height: 32px !important;
}
/* ============================================================================
   Pill‑style filter controls
   ───────────────────────────────────────────────────────────────────────── */

/* The TEXT half (left) – fully rounded on its outside edge only */
/*  ────────────────────────────────────────────────────────────────
    Excel‑like pill filter
    – matches colour / roundness / elevation of .export-button
   ─────────────────────────────────────────────────────────────── */
/*  ────────────────────────────────────────────────────────────────
    Design tokens – re‑use the exact same values your Export button
   ─────────────────────────────────────────────────────────────── */
/*  ────────────────────────────────────────────────────────────────
    Filter‑pill  (label + icon)
    • shares typography / colours with .export-button
    • uses DISTINCT 8 px radius on the two exposed corners only
   ─────────────────────────────────────────────────────────────── */

/* 1. Design tokens – reuse your global blue + corner radius values */
:root {
    --filter-blue:  #00509e;   /* same blue as .export-button           */
    --filter-radius: 8px;      /* ≈ corner radius in your screenshot    */
}

/* 2. Shared typography / sizing for BOTH halves */
.pill-left,
.pill-right {
    font-size: 1.05rem;
    font-weight: 500;
    line-height: normal;
    height: 32px;              /* matches toolbar height                */
    padding: 0 0.7rem;

    border: 0.5px solid var(--filter-blue);
    transition: background-color .3s ease, color .3s ease;
}

/* 3. LEFT half – white fill, blue text, rounded outer edge only */
.pill-left {
    color: var(--filter-blue);
    background: #fff;

    border-right: 0;                 /* weld to the icon half          */
    border-top-left-radius:  var(--filter-radius) !important;
    border-bottom-left-radius: var(--filter-radius) !important;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
/* 4 ▸ RIGHT‑hand half  –  fixed blue in ALL states
   ────────────────────────────────────────────────────────────── */
.pill-right{
    /* base look */
    background: var(--filter-blue) !important;
    color: #fff !important;
    border: 0.5px solid var(--filter-blue) !important;

    /* stop Bootstrap from substituting a darker tint */
    --bs-btn-bg:           var(--filter-blue);
    --bs-btn-border-color: var(--filter-blue);
    --bs-btn-hover-bg:     var(--filter-blue);
    --bs-btn-active-bg:    var(--filter-blue);
    --bs-btn-hover-border-color:  var(--filter-blue);
    --bs-btn-active-border-color: var(--filter-blue);

    /* remove the darkening vignette some themes add */
    box-shadow: none !important;
    filter: none !important;
}

/* same colour on hover / active / focus */
.pill-right:hover,
.pill-right:active,
.pill-right.active,
.pill-right:focus,
.pill-right:focus-visible{
    background: var(--filter-blue) !important;
    border-color: var(--filter-blue) !important;
    color: #fff !important;
    box-shadow: none !important;   /* no inset‑shadow */
    filter: none !important;       /* no brightness() tweak */
}

/* if the component also carries the .btn class, catch that too */
.pill-right.btn,
.pill-right.btn:hover,
.pill-right.btn:active,
.pill-right.btn.active{
    background: var(--filter-blue) !important;
    border-color: var(--filter-blue) !important;
    color: #fff !important;
}
.clear-filters:active{
        background: var(--filter-blue) !important;
    border-color: var(--filter-blue) !important;
    color: #fff !important;
}
/* 5. Hover / active – both halves become blue with white text   */
.pill-left:hover,
.pill-right:hover,
.pill-left:active,
.pill-right:active,
.pill-left.active,
.pill-right.active {
    background: #00509e;
    color: #fff;
}

/* 6. Undo Bootstrap’s radius‑reset inside InputGroup            */
.pill-control > .pill-left,
.pill-control > .pill-right { border-radius: 0; }

.pill-control > .pill-left  {
    border-top-left-radius:  var(--filter-radius) !important;
    border-bottom-left-radius: var(--filter-radius) !important;
}
.pill-control > .pill-right {
    border-top-right-radius:  var(--filter-radius) !important;
    border-bottom-right-radius: var(--filter-radius) !important;
}
:root {
    --filter-blue: #00509e;   /* master brand blue                       */
    --filter-radius: 6px;
}

/* ─────────────────────────────────────────────────────────────
   DATE‑picker right half
   ───────────────────────────────────────────────────────────── */
.date-right,
.date-right:hover,
.date-right:focus,
.date-right:active {
    background: var(--filter-blue) !important;
    border: 0.5px solid var(--filter-blue) !important;
    color: #fff !important;          /* icon inherits currentColor         */

    border-top-right-radius:  var(--filter-radius) !important;
    border-bottom-right-radius:  var(--filter-radius) !important;
}
.date-right svg,
.date-right .iconify {          /* Iconify wraps the svg in <span class="iconify"> */
    position: relative;
    top: -2px;                  /* ↑ move up; use -2px if you want a bit more */
    /* or: transform: translateY(-1px);  — identical visual result */
}
/* ─────────────────────────────────────────────────────────────
   OFF‑MARKET toggle right half
   ───────────────────────────────────────────────────────────── */
.toggle-right,
.toggle-right:hover,
.toggle-right:focus,
.toggle-right:active {
    background: var(--filter-blue) !important;
    border: 0.5px solid var(--filter-blue) !important;
    color: #fff !important;
        border-top-right-radius:  var(--filter-radius) !important;
    border-bottom-right-radius:  var(--filter-radius) !important;
}

/* NEW: vertical nudge */
.toggle-right .form-check-input {
    /*margin: 0;                 /* you already have this – keep it        */
    /*position: relative;        /* Bootstrap already sets this, but safe  */
    top: 2px;                  /* ↓ move the whole toggle 2 px down      */
    /* or: transform: translateY(2px);  ← same visual result             */
}
.toggle-right .form-check-input,
.toggle-right .form-check-input:checked {
    background-color: #fff;          /* white track                         */
    border-color: #fff;
}
.toggle-right .form-check-input:checked::before {
    background-color: var(--filter-blue);   /* blue thumb on white track     */
}

.ag-theme-alpine .ag-overlay-no-rows-center {
  color: var(--gray-700);
  font-weight: 500;
  background: linear-gradient(0deg, var(--blue-050), transparent);
  border: 1px dashed color-mix(in srgb, var(--blue-500) 35%, transparent);
  border-radius: 2px;
  padding: .6rem .9rem;
}

.ag-header-cell-label .ag-sort-order {
  display: none !important;
}

.custom-ag-grid.grid-hidden {
  opacity: 0;
  pointer-events: none;
}
.custom-ag-grid.grid-visible {
  opacity: 1;
  transition: opacity .12s ease-in !important;
}
/* Hide the hamburger by default; reveal on hover/focus only */

.custom-ag-grid.grid-visible .ag-header-cell:hover .ag-icon-menu,
.custom-ag-grid.grid-visible .ag-header-cell.ag-header-cell-focus .ag-icon-menu {
  opacity: 1;
}

/* Price‑Intelligence – DataTable tooltip theme */
.pi-table .dash-table-tooltip {
  z-index: 2000 !important;                /* above cards/plots */
  background: #fff !important;
  color: #334155 !important;               /* slate-700 */
  border: 1px solid rgba(0,0,0,.08) !important;
  border-radius: .5rem !important;         /* 8px */
  padding: 6px 8px !important;
  box-shadow: 0 .5rem 1rem rgba(0,0,0,.15) !important;
  font-size: 0.90rem !important;
  line-height: 1.25rem !important;
  white-space: normal !important;
  max-width: 28rem !important;
  pointer-events: none !important;
}

/* optional little arrow on the left edge */
.pi-table .dash-table-tooltip::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -7px;
  transform: translateY(-50%);
  border-width: 7px;
  border-style: solid;
  border-color: transparent rgba(0,0,0,.08) transparent transparent;
}
.pi-table .dash-table-tooltip::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -6px;
  transform: translateY(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: transparent #fff transparent transparent;
}


.timeline-pill{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Optional: progressively tighten on smaller screens */
@media (max-width: 1200px){
  #packs-chosen-display, #date-selection-display { max-width: 200px; }
}
@media (max-width: 1100px){
  #packs-chosen-display, #date-selection-display { max-width: 170px; }
}
@media (max-width: 992px){
  /* hide the date pill on very narrow screens to avoid overflow */
  #date-selection-display { display: none; }
}

._dash-loading, #_dash-loading { display: none !important; }


.dropdown-menu-dark .dropdown-item.active,
.dropdown-menu-dark .dropdown-item:active {
  background-color: rgba(255,255,255,.10) !important;
  color: #fff !important;
}
.dropdown-menu-dark .dropdown-item:hover {
  background-color: rgba(255,255,255,.06);
}


.ag-link-cell { white-space: nowrap; text-decoration: underline; cursor: pointer; }

#filters-card .aligned-radios .form-check {
  padding-left: 0;      /* remove Bootstrap’s default indent */
  margin-bottom: 0;
}
#filters-card .aligned-radios .form-check-input {
  margin-left: 0;       /* bullet starts at x = 0 */
  margin-right: .4rem;  /* small space before label text */
}
#filters-card .aligned-radios.form-check-inline,
#filters-card .aligned-radios .form-check-inline {
  margin-right: 1rem;   /* even gap between options */
}

/* === Filters – brand styling =================================================
   Uses project tokens defined in :root (blue/gray scale + semantic colors)
   Safe to paste after Bootstrap; only targets the left filter card.
============================================================================= */

/* Card header + section titles */
#filters-card .custom-card-header {
  background: var(--blue-050);
  color: var(--blue-700);
  border-bottom: 1px solid var(--gray-200);
}
#filters-card .section-title { font-weight: 600; color: var(--blue-700); }
#filters-card .filters-divider { border-top: 1px solid var(--gray-200); margin: .35rem 0 .5rem; }

/* Sticky area: subtle fade separator */
#filters-card .sticky-top-block::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 10px;
  background: linear-gradient(to bottom, rgba(0,0,0,.06), transparent);
  pointer-events: none;
}

/* Buttons & badges in header */
#filters-card .clear-filters.btn {
  --btn-border: var(--gray-200);
  --btn-hover-bg: var(--blue-050);
  --btn-hover-border: var(--blue-600);
  font-size: .8rem; padding: .15rem .5rem; border-color: var(--btn-border);
}
#filters-card .clear-filters.btn:hover { background: var(--btn-hover-bg); border-color: var(--btn-hover-border); }
#filters-card .badge.bg-primary,
#filters-card .badge.text-bg-primary,
#filters-card .badge.badge-primary {
  background: var(--blue-600);
}

/* Links (e.g., “More product filters”) */
#filters-card .btn-link { color: var(--blue-600); }
#filters-card .btn-link:hover { color: var(--blue-700); text-decoration: none; }

/* Compact dropdowns (dcc.Dropdown – react-select DOM) */
#filters-card .dd-compact .Select-control {
  min-height: 32px; height: 32px; border-color: var(--gray-200);
}
#filters-card .dd-compact .Select-input { height: 30px; }
#filters-card .dd-compact .Select-placeholder,
#filters-card .dd-compact .Select--single > .Select-control .Select-value {
  line-height: 30px; padding-left: 6px; padding-right: 6px;
}
#filters-card .dd-compact .Select-value-label { font-size: .9rem; }
#filters-card .Select-control:hover { border-color: var(--blue-600); }
#filters-card .is-focused:not(.is-open) > .Select-control {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 .15rem rgba(0,80,158,.20); /* blue-600 focus ring */
}
#filters-card .Select-menu-outer { border-color: var(--blue-600); box-shadow: 0 6px 16px rgba(0,0,0,.08); }
#filters-card .Select-option.is-focused { background: var(--blue-050); color: var(--gray-900); }
#filters-card .Select-option.is-selected { background: var(--blue-100); color: var(--blue-700); }

/* Segmented radios (dbc.RadioItems) */
#filters-card .aligned-radios .form-check-inline { margin-right: .25rem; }
#filters-card .aligned-radios .form-check-input { position: absolute; opacity: 0; }
#filters-card .aligned-radios .form-check-label {
  display: inline-block; padding: .15rem .6rem; border: 1px solid var(--gray-200);
  border-radius: 9999px; cursor: pointer; user-select: none; transition: all .12s ease-in-out;
  background: #fff; color: var(--gray-700);
}
#filters-card .aligned-radios .form-check-label:hover { background: var(--blue-050); border-color: var(--blue-600); }
#filters-card .aligned-radios .form-check-input:focus + .form-check-label {
  box-shadow: 0 0 0 .15rem rgba(0,80,158,.20);
  border-color: var(--blue-600);
}
#filters-card .aligned-radios .form-check-input:checked + .form-check-label {
  background: var(--blue-100);
  border-color: var(--blue-600);
  color: var(--blue-600);
}
#filters-card .aligned-radios .form-check-input:disabled + .form-check-label {
  color: var(--gray-500); background: var(--gray-050); border-color: var(--gray-200); cursor: not-allowed;
}

/* Label and helper text colors */
#filters-card small.text-muted { color: var(--gray-700) !important; opacity: .85; }

/* Card body background for contrast against page grid */
#filters-card .card-body { background: #fff; }

/* Optional: unify DataTable header inside filters (if you add any tables later) */
#filters-card .dash-table-container .dash-header {
  background: var(--blue-050); color: var(--blue-700);
}

/* Prefer reduced motion: remove transitions if the user asks */
@media (prefers-reduced-motion: reduce) {
  #filters-card .aligned-radios .form-check-label { transition: none; }
}
/* Equal‑width segmented radio buttons (works for 2 or more options) */
#filters-card .aligned-radios{
  display: flex;             /* lay items in one row */
  gap: .375rem;              /* spacing between pills */
  align-items: stretch;
  flex-wrap: nowrap;
}
#filters-card .aligned-radios .form-check-label{
  border-radius: var(--bs-border-radius, .375rem) !important; /* matches Bootstrap btn radius */
}

.btn.segmented:focus-visible,
.form-select:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
}
#filters-card .aligned-radios .form-check-inline{
  margin-right: 0 !important;/* override Bootstrap inline spacing */
  flex: 1 1 0;               /* make all options share the width evenly */
  display: flex;             /* so the label can fill the item */
}

#filters-card .aligned-radios .form-check-label{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;   /* center the text */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 34px;          /* consistent height */
  padding: 0 .75rem;         /* consistent horizontal padding */
  border-radius: 9999px;     /* keep pill look */
}


/* ───────────────────────────────────────────────────────────────
   TOP TOOLBAR — square-ish segmented buttons with small spacing
   (override the previous pill style)
   ─────────────────────────────────────────────────────────────── */
/* ───────────────────────────────────────────────────────────────
   TOP TOOLBAR — segmented buttons styled like the left-rail radios
   (keeps buttons for logic, but copies the radio pill visuals)
   ─────────────────────────────────────────────────────────────── */
#top-toolbar .segmented-group .btn {
  height: 32px;                /* same vertical rhythm */
  line-height: 30px;
  padding: 0 .65rem;           /* compact text fit     */
  font-size: .92rem;
  font-weight: 500;
  border-radius: 9999px;       /* pill endcaps */
  box-shadow: none !important;
}

/* tighten the seam between segments */
#top-toolbar .segmented-group .btn + .btn { margin-left: -1px; }

/* make the segments share the endcaps */
#top-toolbar .segmented-group .btn:first-child {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
#top-toolbar .segmented-group .btn:last-child {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* INACTIVE segment — white bg, gray border, blue text (like radios) */
#top-toolbar .segmented-group .btn-outline-primary:not(.active) {
  background: #fff !important;
  color: var(--blue-600) !important;       /* radio label color */
  border-color: var(--gray-200) !important;
}

/* HOVER (inactive) – subtle, like radios */
#top-toolbar .segmented-group .btn-outline-primary:not(.active):hover {
  background: var(--blue-050) !important;
  border-color: var(--blue-600) !important;
  color: var(--blue-600) !important;
}

/* ACTIVE segment — light-blue bg, blue text/border (like radios) */
#top-toolbar .segmented-group .btn-outline-primary.active {
  background: var(--blue-100) !important;
  color: var(--blue-600) !important;
  border-color: var(--blue-600) !important;
}

/* Focus ring matches your left-rail radios */
#top-toolbar .segmented-group .btn:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 .15rem rgba(0,80,158,.20) !important;
}

#top-toolbar .segmented-group{
  /* knobs */
  --seg-gap: .375rem;                            /* space between buttons    */
  --seg-radius: var(--filter-radius, 6px);       /* same square-ish radius   */

  display: inline-flex;                          /* ensure gap works         */
  gap: var(--seg-gap);                           /* modern browsers          */
}

/* square-ish ends on every segment */
#top-toolbar .segmented-group .btn{
  border-radius: var(--seg-radius) !important;
}

/* kill Bootstrap’s weld and our earlier -1px rule, add real spacing */
#top-toolbar .segmented-group .btn + .btn{
  margin-left: var(--seg-gap) !important;
}

/* optional: make the outline a touch calmer to match the rest */
#top-toolbar .segmented-group .btn-outline-primary{
  border-color: var(--gray-300, var(--gray-200)) !important;
}
/* ──────────────────────────────────────────────────────────────────
   TOP TOOLBAR — snappier segmented controls + correct text centering
   (square‑ish corners and a small gap between options)
   ────────────────────────────────────────────────────────────────── */

#top-toolbar .segmented-group,
#top-toolbar .aligned-radios{
  /* layout */
  display: flex;
  align-items: center;
  gap: .375rem;                       /* small separation between items   */
  flex-wrap: nowrap;
}

/* Reset Bootstrap’s spacing inside each item */
#top-toolbar .aligned-radios .form-check{
  padding-left: 0;
  margin-bottom: 0;
}

/* Hide the actual radio and drive styles from its label */
#top-toolbar .aligned-radios .form-check-input{
  position: absolute;
  opacity: 0;
}

/* Square‑ish buttons: exact height + centered label, no transition lag */
#top-toolbar .segmented-group .btn,
#top-toolbar .aligned-radios .form-check-label{
  height: 32px;
  min-height: 32px;
  padding: 0 .75rem;
  border-radius: 6px !important;      /* more square to match other UI    */
  display: inline-flex;               /* vertical centering for the text  */
  align-items: center;
  justify-content: center;
  line-height: 1;                     /* rely on flex for centering       */

  /* remove the “press delay” from Bootstrap transitions */
  transition: none !important;
  -webkit-transition: none !important;
}

/* Base / hover / checked states (keep your palette) */
#top-toolbar .aligned-radios .form-check-label{
  background: #fff;
  color: var(--gray-700);
  border: 1px solid var(--gray-300, var(--gray-200));
}
#top-toolbar .aligned-radios .form-check-label:hover{
  background: var(--blue-050);
  border-color: var(--blue-600);
}
#top-toolbar .aligned-radios .form-check-input:checked + .form-check-label{
  background: var(--blue-100);
  color: var(--blue-700);
  border-color: var(--blue-600);
}

/* Optional: calmer focus ring to match the rest of the UI */
#top-toolbar .aligned-radios .form-check-input:focus + .form-check-label{
  box-shadow: 0 0 0 .15rem rgba(0,80,158,.20);
  border-color: var(--blue-600);
}

/* If you render real <Button>s instead of RadioItems, keep them consistent */
#top-toolbar .segmented-group .btn-outline-primary{
  border-color: var(--gray-300, var(--gray-200)) !important;
}
#top-toolbar .segmented-group .btn,
#top-toolbar .segmented-group .btn:hover,
#top-toolbar .segmented-group .btn:active,
#top-toolbar .segmented-group .btn.active{
  transition: none !important;        /* instant state change             */
  box-shadow: none;                    /* avoid press “lag” shadow         */
}
/* Filters header: number-first active counter */
/* Slightly larger, calm pill (unchanged from before) */
/* Make the "1 Active" block align on the middle */
#filters-card .filters-active{
  display: inline-flex;      /* ← key change */
  align-items: center;       /* vertical centering */
}

/* The hairline divider */
#filters-card .filters-active::before{
  content: "";
  display: block;            /* as a flex item */
  width: 1px;
  height: 1em;               /* tie to text size for perfect centering */
  background: rgba(0,0,0,.12);
  margin: 0 .5rem 0 .625rem; /* space from “Filters” and the pill */
  border-radius: 1px;
}

/* (unchanged) the count pill style you already have */
#filters-card .count-pill{
  background-color: var(--blue-050) !important;
  color: var(--blue-700) !important;
  border: 1px solid var(--blue-100);
  border-radius: 999px;
  font-weight: 700;
  line-height: 1.05;
  min-width: 1.35rem;
  text-align: center;
  padding: .05rem .50rem;
}
#filters-card .count-pill--lead{ font-size: .95rem; }


/* ──────────────────────────────────────────────────────────────────────────
   Episodes quick filters: segmented buttons + compact dropdown
   File: assets/shortages_historical.css
   ────────────────────────────────────────────────────────────────────────── */

/* Accent + neutrals (matches your COL_HIGHLIGHT #1557a2) */
:root {
  --cp-accent: #1557a2;                  /* highlight */
  --cp-accent-tint: rgba(21,87,162,.12); /* chip-like background */
  --cp-accent-brd:  rgba(21,87,162,.35);
  --cp-fg:   #334155;                    /* slate-700 */
  --cp-bg:   #f8fafc;                    /* slate-50 */
  --cp-bg-h: #f1f5f9;                    /* slate-100 */
  --cp-brd:  #cbd5e1;                    /* slate-300 */
  --cp-brd-h:#b6c0ce;                    /* hover border */
  --cp-focus: 0 0 0 2px rgba(21,87,162,.35);
}

/* Quick-filter buttons */
.epf-btn {
  --btn-h: 32px;
  height: var(--btn-h);
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--cp-brd) !important;
  background: var(--cp-bg) !important;
  color: var(--cp-fg) !important;
  line-height: calc(var(--btn-h) - 2px);
  font-weight: 600;
  font-size: .875rem;
  box-shadow: none !important;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease, box-shadow .12s ease;
}

.epf-btn:hover {
  background: var(--cp-bg-h) !important;
  border-color: var(--cp-brd-h) !important;
}

.epf-btn:active {
  background: #e2e8f0 !important;       /* slate-200 */
}

.epf-btn:focus-visible {
  outline: 0;
  box-shadow: var(--cp-focus) !important;
  border-color: var(--cp-accent) !important;
}

/* Selected/pressed look */
.epf-btn--selected,
.epf-btn[aria-pressed="true"] {
  background: var(--cp-accent-tint) !important;
  border-color: var(--cp-accent-brd) !important;
  color: var(--cp-accent) !important;
}

/* Keep pills comfortably spaced when adjacent (optional) */
#sh_hist-ep-filter-btns .epf-btn + .epf-btn { margin-left: 6px; }

/* Compact dcc.Dropdown (react-select v1) */
.dd-compact .Select-control {
  min-height: 32px;
  height: 32px;
  border-radius: 8px;
  border-color: var(--cp-brd);
  box-shadow: none;
}

.dd-compact.Select.is-focused > .Select-control {
  border-color: var(--cp-accent);
  box-shadow: var(--cp-focus);
}

.dd-compact .Select-placeholder,
.dd-compact .Select-value-label {
  line-height: 30px;                     /* 32px minus borders */
  font-size: .875rem;
  color: #475569;                        /* slate-600 */
}

.dd-compact .Select-input { height: 30px; }

.dd-compact .Select-arrow-zone { padding-right: 8px; }
.dd-compact .Select-arrow {
  border-top-color: var(--cp-fg) !important; /* darker arrow */
}

/* Menu / options */
.dd-compact .Select-menu-outer {
  border: 1px solid var(--cp-brd);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 10050;                        /* above offcanvas, etc. */
}

.dd-compact .Select-option {
  padding: 6px 10px;
  font-size: .875rem;
}

.dd-compact .Select-option.is-focused {
  background: var(--cp-accent-tint);
}

.dd-compact .Select-option.is-selected {
  background: rgba(21,87,162,.16);
  color: var(--cp-accent);
}

/* Multi-select niceties (harmless if not used) */
.dd-compact.Select--multi .Select-control { height: auto; min-height: 32px; }
.dd-compact.Select--multi .Select-value   { margin-top: 2px; margin-bottom: 2px; }
.dd-compact.Select--multi .Select-value-icon { color: var(--cp-accent); }
/* Sticky control bar in the episodes offcanvas */
.sh-epbar{
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  padding: 8px 6px 10px;
  border-bottom: 1px solid #e9ecef;
}

/* Pill buttons: subtle segmented-control look */
.epf-btn{
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #dbe4f0;
  color: #2b3035;
  padding: .38rem .85rem;
  line-height: 1.1;
  transition: background-color .15s ease, box-shadow .15s ease, color .15s ease, border-color .15s ease;
}
.epf-btn:hover{
  background: #eef5fd;
  border-color: #cfe1f9;
}
.epf-btn.epf-btn--selected{
  background: #eef5fd;
  color: #1557a2;
  border-color: #cfe1f9;
  box-shadow: 0 0 0 2px rgba(21,87,162,.08) inset;
}

/* Compact, rounded dropdown to match pill height */
.ep-sort .Select-control{
  min-height: 36px;
  border-radius: 12px;
  border-color: #dbe4f0;
  box-shadow: none !important;
}
.ep-sort .Select-placeholder,
.ep-sort .Select-value{
  line-height: 34px;
  padding-left: 10px;
}
.ep-sort .Select-menu-outer{
  border-radius: 10px;
  border-color: #dbe4f0;
}
.ep-sort .Select-option.is-focused{
  background: #eef5fd;
}
