.status-dot {
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background-color: #adb5bd;
}

.status-dot-ok {
  background-color: #198754;
}

.status-dot-warn {
  background-color: #ffc107;
}

.status-dot-bad {
  background-color: #dc3545;
}

.status-dot-unknown {
  background-color: #adb5bd;
}

.extremes-lookback-btn {
  width: 20ch;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 3rem;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

#strategy-tabs .nav-link {
  padding: 0.25rem 0.5rem;
}

#reset-zoom-btn {
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  line-height: 1;
}

/* Chart.js's responsive:true resizes the canvas to fill this wrapper's own
   box - without an explicit height here it instead grows to whatever
   width/aspectRatio computes to, which can exceed the viewport (position:
   relative + a bounded height is Chart.js's own documented pattern for a
   height-capped responsive canvas). calc(100vh - 270px) reserves room for
   everything else stacked on the page above/below the chart card (navbar,
   settings-ticker card, chart card's own header, price-extremes card,
   margins) - tuned against a maximized Full HD window; min-height keeps it
   from going unreasonably short on a small/shared viewport.
*/
.chart-wrap {
  position: relative;
  height: calc(100vh - 270px);
  min-height: 300px;
  max-height: 640px;
}

.latest-candle-label {
  font-size: 0.75rem;
}

.live-price-badge {
  display: inline-block;
  width: 23ch;
  max-width: 100%;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a7f37;
  background-color: rgba(26, 127, 55, 0.1);
  border: 1px solid rgba(26, 127, 55, 0.3);
  border-radius: 0.375rem;
  padding: 0rem 0.5rem;
  font-variant-numeric: tabular-nums;
}

[data-bs-theme="dark"] .live-price-badge {
  color: #7ee787;
  background-color: rgba(126, 231, 135, 0.12);
  border-color: rgba(126, 231, 135, 0.35);
}

.highlight-badge {
  font-size: 0.95rem;
  font-weight: 700;
  background-color: rgba(13, 110, 253, 0.08);
  border: 1px solid rgba(13, 110, 253, 0.25);
  border-radius: 0.375rem;
  padding: 0.15rem 0.5rem;
  font-variant-numeric: tabular-nums;
}

.highlight-badge .text-body-secondary {
  font-weight: 400;
}

[data-bs-theme="dark"] .highlight-badge {
  background-color: rgba(102, 178, 255, 0.1);
  border-color: rgba(102, 178, 255, 0.3);
}

.profile-icon-btn {
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.settings-section-title {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--bs-secondary-color);
  margin-bottom: 0.75rem;
}

#notification-lookback-group .form-check-input:disabled,
#trading-strategy-group .form-check-input:disabled {
  opacity: 0.25;
}

#notification-lookback-group .form-check-input:disabled ~ .form-check-label,
#trading-strategy-group .form-check-input:disabled ~ .form-check-label {
  opacity: 0.4;
  text-decoration: line-through;
}

.trading-strategy-playpause-btn {
  color: var(--bs-form-check-input-checked-bg-color, #0d6efd);
}

/* grid_trading's min/max range picker: two native range inputs stacked on
   the same track via absolute positioning, each with a transparent runnable
   track so only its own thumb is visible - the oldest no-dependency way to
   fake a dual-handle slider out of <input type="range">. Extra top padding
   on the track makes room for each thumb's own floating value label. */
.grid-range-track {
  height: 1.25rem;
  min-width: 8rem;
  margin-top: 3.3rem;
  margin-bottom: 1.1rem;
}

.grid-range-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  margin: 0;
  background: transparent;
  pointer-events: none;
}

.grid-range-input::-webkit-slider-thumb {
  pointer-events: auto;
}

.grid-range-input::-moz-range-thumb {
  pointer-events: auto;
}

/* One per handle, positioned by left% (set from JS - see
   buildGridTradingRangePicker's positionLabel) and centered on that %
   via translateX, so each label tracks its own thumb rather than sitting
   at a fixed spot. */
.grid-range-label {
  position: absolute;
  top: -1.1rem;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
  white-space: nowrap;
  pointer-events: none;
}

/* Live-price marker: a plain green dot sitting on the track (not a 3rd
   <input type="range"> - it's read-only, nothing for the user to drag),
   positioned/shown by updateGridRangeLivePriceMarker. Vertically centered
   on the track itself, unlike the min/max labels which float above it. */
.grid-range-live-marker {
  position: absolute;
  top: 50%;
  width: 0.6rem;
  height: 0.6rem;
  margin-left: -0.3rem;
  margin-top: -0.3rem;
  border-radius: 50%;
  background-color: #198754;
  border: 1px solid var(--bs-body-bg);
  pointer-events: none;
}

.grid-range-label-live {
  color: #198754;
  font-weight: 600;
  top: -3.3rem; /* topmost row - above the SOL/USDC split row, which is itself above the min/max value labels */
}

.grid-range-label-live-split {
  color: #198754;
  top: -2.2rem; /* middle row, directly below the live-price row and above the min/max value labels */
}

/* Static placeholder captions below each handle (fixed "SOL 100%"/
   "USDC 100%" text, not derived from any computation - see
   buildGridTradingRangePicker). Mirrors .grid-range-label but anchored
   below the track instead of above it. */
.grid-range-sublabel {
  position: absolute;
  bottom: -1.1rem;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
  white-space: nowrap;
  pointer-events: none;
}

.grid-range-readout {
  white-space: nowrap;
  min-width: 4.5rem;
  text-align: right;
}

/* grid_trading's number-of-levels picker: a single, ordinary <input
   type="range"> (unlike .grid-range-input above, there's only one thumb
   here, so no absolute-positioned overlay trick needed) sharing the same
   .grid-range-track/.grid-range-label treatment for its floating value
   label. */
.grid-levels-input {
  position: relative;
  width: 100%;
  margin: 0;
}

.grid-levels-caption {
  white-space: nowrap;
}

/* Settings ticker: scrolling one-line summary of the logged-in user's current settings */
.settings-ticker {
  overflow: hidden;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}

.settings-ticker-track {
  display: inline-block;
  padding-left: 100%;
  font-size: 0.85rem;
  line-height: 1.2;
  color: var(--bs-secondary-color);
  animation: settings-ticker-scroll 30s linear infinite;
}

.settings-ticker:hover .settings-ticker-track {
  animation-play-state: paused;
}

.settings-ticker-track .settings-ticker-sep {
  margin: 0 0.75em;
  opacity: 0.5;
}

.settings-ticker-track .fw-bold {
  color: var(--bs-body-color);
}

.settings-ticker-track .settings-ticker-strategy .status-dot {
  margin-right: 0.35em;
  vertical-align: middle;
}

.settings-ticker-track .settings-ticker-strategy-sep {
  margin-right: 0.4em;
  opacity: 0.5;
}

@keyframes settings-ticker-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-100%);
  }
}

/* Mobile portrait (below Bootstrap's sm breakpoint, 576px) - the rest of the
   layout is plain Bootstrap flex-wrap, which already reflows on its own;
   these overrides only touch the spots with a fixed size or desktop-density
   spacing that don't shrink gracefully on their own. */
@media (max-width: 575.98px) {
  .navbar-brand {
    font-size: 0.8rem;
  }

  /* Secondary health readouts (uptime/collector dots) take a back seat to
     the brand, live price, and auth controls on a narrow screen - smaller
     text keeps the navbar from ballooning to 5+ wrapped rows. */
  .navbar .text-body.small {
    font-size: 0.75rem;
  }

  .live-price-badge {
    width: auto;
    font-size: 0.85rem;
  }

  /* 20ch fixed width (desktop, see .extremes-lookback-btn above) is wider
     than half of most phone screens - each button is a plain block child of
     its own row-cols-2 .col wrapper (see app.js's renderExtremesLookbackButtons),
     so width:100% here simply fills that column instead of fighting it. */
  .extremes-lookback-btn {
    width: 100%;
  }

  .settings-ticker-track {
    font-size: 0.8rem;
  }

  /* Candle chart header: pair/timeframe/source badges + Reset Zoom stay on
     their own first line (card-header's flex-wrap already does that once
     the toggle groups below are forced full-width via flex-basis); the
     S/R-POC and wallet-level "show/hide" toggles each then drop to their
     own full-width row and lay out as a Bootstrap row-cols-2 grid (see
     index.html), so they read as 2-up grids instead of one toggle per
     line. */
  #sr-poc-toggle-group,
  #wallet-levels-toggle-group {
    flex-basis: 100%;
  }

  /* The desktop calc(100vh - 270px)/640px cap (above) was tuned against Full
     HD's one-row navbar - on a phone the navbar wraps into several more
     rows (brand, status items, live price, auth buttons each own their own
     line at this width), so a smaller fixed offset and a lower ceiling fit
     better than reusing the desktop numbers verbatim. */
  .chart-wrap {
    height: calc(100vh - 420px);
    min-height: 220px;
    max-height: 420px;
  }
}
