/* ── Brand color derived from RideFlux logo (#1e63ff) ── */
:root {
    --bs-primary:           #1e63ff;
    --bs-primary-rgb:       30, 99, 255;
    --bs-link-color:        #1e63ff;
    --bs-link-color-rgb:    30, 99, 255;
    --bs-link-hover-color:  #1650d4;
}

.btn-primary {
    --bs-btn-bg:                #1e63ff;
    --bs-btn-border-color:      #1e63ff;
    --bs-btn-hover-bg:          #1650d4;
    --bs-btn-hover-border-color:#1650d4;
    --bs-btn-active-bg:         #1244b0;
    --bs-btn-active-border-color:#1244b0;
    --bs-btn-disabled-bg:       #1e63ff;
    --bs-btn-disabled-border-color: #1e63ff;
}

.btn-outline-primary {
    --bs-btn-color:             #1e63ff;
    --bs-btn-border-color:      #1e63ff;
    --bs-btn-hover-bg:          #1e63ff;
    --bs-btn-hover-border-color:#1e63ff;
    --bs-btn-active-bg:         #1e63ff;
    --bs-btn-active-border-color:#1e63ff;
}

.bg-primary  { background-color: #1e63ff !important; }
.text-primary { color: #1e63ff !important; }
.border-primary { border-color: #1e63ff !important; }

/* restyle radio items */
.radio-group .form-check {
  padding-left: 0;
}

.radio-group .btn-group > .form-check:not(:last-child) > .btn {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.radio-group .btn-group > .form-check:not(:first-child) > .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  margin-left: -1px;
}

/* restyle checklist items as button group */
.checklist-group .form-check {
  padding-left: 0;
}

.checklist-group .btn-group > .form-check:not(:last-child) > .btn {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.checklist-group .btn-group > .form-check:not(:first-child) > .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  margin-left: -1px;
}

/* Responsive layout contracts shared by Home, LEV, and RTV. */
.home-nav-card,
.home-data-column,
.lev-filter-row > *,
.lev-workspace-row > *,
.rtv-selection-row > *,
.rtv-controls > *,
.rtv-stats-row > * {
  min-width: 0;
}

.lev-graph-type .btn-group,
.rtv-controls,
.rtv-controls .btn-group {
  display: flex;
  flex-wrap: wrap;
}

.lev-graph-type .form-check,
.rtv-controls .form-check {
  margin-bottom: 0.25rem;
}

.lev-workspace-row .js-plotly-plot,
.lev-workspace-row .plot-container,
#graph-div,
#stats-table-bag1,
#stats-table-bag2 {
  max-width: 100%;
}

#stats-table-bag1,
#stats-table-bag2 {
  overflow-x: auto;
}

#lev-rangeslider .rc-slider-mark-text:first-child {
  transform: translateX(0) !important;
  text-align: left;
}

#lev-rangeslider .rc-slider-mark-text:last-child {
  transform: translateX(-100%) !important;
  text-align: right;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid rgba(30, 99, 255, 0.45);
  outline-offset: 2px;
  box-shadow: 0 0 0 0.2rem rgba(30, 99, 255, 0.18);
}

.navbar-toggler:focus,
.navbar-toggler:focus-visible,
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(30, 99, 255, 0.45) !important;
  outline-offset: 2px !important;
}

@media (max-width: 991.98px) {
  .navbar-toggler,
  .btn,
  .form-control,
  .form-select,
  .Select-control {
    min-height: 44px;
  }

  .navbar-toggler {
    border-color: rgba(30, 99, 255, 0.45);
  }

  .navbar-toggler-icon {
    filter: invert(32%) sepia(99%) saturate(3157%) hue-rotate(219deg) brightness(101%) contrast(101%);
  }

  .rtv-control-divider {
    display: none;
  }

  .rtv-sticky-controls {
    position: static !important;
  }

  .lev-map-controls > .col {
    flex: 0 0 auto;
    width: 50%;
  }

  .lev-map-controls > .lev-color-range {
    width: 100%;
  }

  .rtv-controls > .col-auto:first-child,
  .rtv-controls > .col-auto:first-child > div {
    width: 100%;
  }

  .rtv-controls #graph-type-radio {
    width: 100% !important;
  }

  .form-check,
  .form-check-label {
    min-height: 44px;
  }

  .form-check {
    display: inline-flex;
    align-items: center;
    column-gap: 0.375rem;
  }

  .form-check-label {
    display: inline-flex;
    align-items: center;
  }

  .form-check-input {
    margin-top: 0;
  }

  .rc-slider-handle::before {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    content: "";
    transform: translate(-50%, -50%);
  }

  .modebar-btn {
    display: inline-flex !important;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }

  .lev-filter-row,
  .lev-workspace-row,
  .rtv-selection-row,
  .rtv-controls,
  .rtv-stats-row {
    margin-right: 0;
    margin-left: 0;
  }
}
