.total-volume-dashboard {
  max-width: 900px; /* readable line length / table width */
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

/* Page title for this tab only (overrides generic h1 from dashboard.css if any). */
.total-volume-dashboard h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 12px;
  color: #f4f4f5;
}

/* .sr-only — visually hidden text kept for screen readers (e.g. “Open chart”). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* -----------------------------------------------------------------------------
   Toolbar: wraps “Back” when drilling down the exercise hierarchy.
   Hidden via HTML `hidden` when at root; shown when volumeParentId is set in JS.
   ----------------------------------------------------------------------------- */
.volume-toolbar {
  margin-bottom: 12px;
}

/* Primary control to go up one level in the hierarchy. */
.volume-back-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #2a2a2e;
  background: #16161a;
  color: #e4e4e7;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.volume-back-btn:hover {
  background: #1f1f24;
  border-color: #3f3f46;
}

/* -----------------------------------------------------------------------------
   Loading skeleton — shown while /total-volume is fetching.
   JS toggles .hidden on #chart-skeleton-volume (same pattern as favourites).
   ----------------------------------------------------------------------------- */
#chart-skeleton-volume {
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* When JS adds class "hidden", skeleton rows disappear. */
#chart-skeleton-volume.hidden {
  display: none;
}

/* Each fake row bar. */
#chart-skeleton-volume .skeleton-bar {
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(90deg, #1e1e24 25%, #2a2a32 50%, #1e1e24 75%);
  background-size: 200% 100%;
  animation: volume-shimmer 1.5s ease-in-out infinite;
}

/* Shimmer keyframes — horizontal sweep so loading feels alive. */
@keyframes volume-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* -----------------------------------------------------------------------------
   Table wrapper — shares .chart-inner with favourites for scroll box styling
   from fav-exercises-dashboard.css (min-height 320px). Reset min-height here so
   short tables don’t leave a huge empty gap.
   ----------------------------------------------------------------------------- */
#volume-table-inner.chart-inner {
  min-height: 0;
}

.volume-table-inner {
  width: 100%;
}

/* -----------------------------------------------------------------------------
   Table — semantic grid for rank, exercise, chart button, volume.
   ----------------------------------------------------------------------------- */
.volume-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  line-height: 1.35;
}

.volume-table thead th {
  padding: 12px 10px;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  color: #a1a1aa;
  background: #1a1a1e;
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: 0 1px 0 0 #2a2a2e;
  /* drop text-transform: uppercase if you want literal match to workout table */
}

.volume-table tbody td {
  padding: 12px;
  vertical-align: middle;
  border-bottom: 1px solid #27272a;
  color: #f4f4f5;
}

/* Remove double border after last row. */
.volume-table tbody tr:last-child td {
  border-bottom: none;
}

/* Subtle hover to show row boundaries on touch/desktop. */
.volume-table tbody tr:hover td {
  background: rgba(39, 39, 42, 0.35);
}

/* -----------------------------------------------------------------------------
   Column: rank (#) — API `rank`, right-aligned tabular digits.
   ----------------------------------------------------------------------------- */
.volume-col-rank {
  width: 2.25rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #71717a;
  font-weight: 600;
}

/* -----------------------------------------------------------------------------
   Column: exercise — plain text for leaves; button for parents (drill-down).
   ----------------------------------------------------------------------------- */
.volume-col-exercise {
  min-width: 0;
  width: auto;
  flex: 1;
  font-weight: 500;
}

/* Drill control: looks like text + chevron, not a link (no underline). */
.volume-exercise-drill {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  max-width: 100%;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: #e4e4e7;
  cursor: pointer;
  font: inherit;
  text-align: left;
  text-decoration: none;
}

/* Highlight name on hover; chevron keeps accent color (see below). */
.volume-exercise-drill:hover .volume-exercise-drill-label {
  color: #22d3ee;
}

/* Trailing “>” for exercises that expand to children. */
.volume-exercise-drill-chevron {
  color: #22d3ee;
  font-weight: 600;
  flex-shrink: 0;
}

/* -----------------------------------------------------------------------------
   Column: chart — opens full chart / future sparkline (minichart button).
   ----------------------------------------------------------------------------- */
.volume-col-chart {
  width: 4.5rem;
  text-align: center;
}

/* Visible “Chart” label in header; .sr-only next to it for a11y if you use both. */
.volume-col-chart-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #71717a;
}

/* Placeholder until real sparkline/canvas preview exists. */
.volume-minichart-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px dashed #3f3f46;
  border-radius: 10px;
  background: linear-gradient(180deg, #1a1a1f 0%, #141418 100%);
  color: #22d3ee;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.volume-minichart-placeholder:hover {
  border-color: #22d3ee;
  background: #1c2124;
  color: #67e8f9;
}

.volume-minichart-placeholder:focus-visible {
  outline: 2px solid #22d3ee;
  outline-offset: 2px;
}

/* -----------------------------------------------------------------------------
   Column: total volume — numeric, tabular, accent color (matches app cyan).
   Values are formatted in JS (Intl) with thousands separators.
   ----------------------------------------------------------------------------- */
.volume-col-vol {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #22d3ee;
  white-space: nowrap;
}

/* -----------------------------------------------------------------------------
   Optional message under the table when URL has ?volumeChart= (future full chart).
   ----------------------------------------------------------------------------- */
.volume-chart-placeholder {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #16161a;
  border: 1px solid #2a2a2e;
  color: #a1a1aa;
  font-size: 13px;
  line-height: 1.45;
}

.volume-chart-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 1000;
  max-width: min(90vw, 360px);
  padding: 12px 20px;
  border-radius: 10px;
  background: #27272a;
  border: 1px solid #3f3f46;
  color: #f4f4f5;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  transform: translateX(-50%) translateY(120%);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
  pointer-events: none;
}

.volume-chart-toast.volume-chart-toast--visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* -----------------------------------------------------------------------------
   Narrow screens — tighter padding; hide “Chart” header label to save space.
   ----------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .volume-table thead th,
  .volume-table tbody td {
    padding: 10px 8px;
  }

  .volume-col-chart-label {
    display: none;
  }
}
