/* ShapeUp — Exercise Log: Summary tab.
 *
 * A card list of every exercise ever logged. Cards deliberately REUSE the Log
 * tab's .xl-card / .xl-card-head / .xl-card-name / .xl-card-muscle /
 * .xl-summary-btn rules (in exercise.css) so the typography — font, size, weight
 * — is identical to the exercise cards. The expanded panel is the same
 * .xl-summary-panel + .xls-* markup used on the Log tab (rendered by
 * window.ShapeUpLog.createSummaryView). Only the summary-tab-specific chrome
 * (wrapper, intro, PR badge, open-state accent, empty/loading) lives here.
 */

/* No top padding here: the sticky header supplies its own top padding so it can
   pin flush to the scrollport top with nothing scrolling through above it. */
.xl-summary-tab { padding: 0 12px 32px; }

.xl-sum-loading {
  padding: 32px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* Intro line + search bar stick to the top of the scroll container as one band
   while the card list scrolls beneath. `top: 0` pins it flush to .xl-main's
   padding-box top. The ::before extends the white background UPWARD to cover
   .xl-main's own top padding (16px) so no card shows through in that gap; the
   negative side margins bleed the band out to the scrollport edges so cards
   can't peek past the sides either. */
.xl-sum-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--canvas);
  margin: 0 -12px;
  padding: 12px 12px 12px;
}
.xl-sum-header::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 100%;
  height: 24px;                 /* ≥ .xl-main top padding (16px) */
  background: var(--canvas);
}

/* Intro line above the card list. */
.xl-sum-intro {
  margin: 0;
  padding: 2px 2px 10px;
}
.xl-sum-intro-title {
  font-size: 14px; font-weight: 600; color: var(--ink);
}
.xl-sum-intro-sub {
  font-size: 11px; color: var(--muted); margin-top: 2px;
}

/* Search bar — filters cards by exercise name or muscle. */
/* Filled-pill search, matching the manual-picker search bar (.xl-manual-search). */
.xl-sum-search {
  display: flex; align-items: center; gap: 9px;
  background: #EFF0F3; border-radius: 12px; padding: 11px 14px;
}
.xl-sum-search-icon {
  display: flex; flex-shrink: 0;
  color: var(--muted);
  pointer-events: none;
}
.xl-sum-search-icon svg { width: 17px; height: 17px; }
.xl-sum-search-input {
  border: none; background: none; outline: none; flex: 1; min-width: 0;
  font-size: 16px; /* ≥16px: no iOS focus zoom */
  font-family: inherit;
  color: var(--ink);
}
.xl-sum-search-input::placeholder { color: var(--muted); }

/* Clear (×) button — appears only when there's text in the search box. */
.xl-sum-search-clear {
  display: none;
  align-items: center; justify-content: center;
  flex-shrink: 0;
  width: 22px; height: 22px; padding: 0;
  border: none; border-radius: 50%;
  background: transparent; color: var(--muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.xl-sum-search-clear.show { display: inline-flex; }
.xl-sum-search-clear:hover { background: rgba(0, 0, 0, 0.06); color: var(--slate); }
.xl-sum-search-clear svg { width: 14px; height: 14px; }

/* No card matches the current search. */
.xl-sum-noresults {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
}
.xl-sum-noresults-title {
  font-size: 13px; font-weight: 600; color: var(--slate);
}
.xl-sum-noresults-sub {
  font-size: 11px; color: var(--muted); margin-top: 4px;
}

.xl-sum-list { display: block; }

/* The collapsed card. Base look comes from .xl-card; add a blue accent when
   the summary panel is open (mirrors the Log tab's in-progress card). */
.xl-sum-card.open { border-color: var(--blue); }

/* Right-side all-time PR badge on the collapsed card row. */
.xl-sum-pr {
  flex: 0 0 auto;
  display: inline-flex; align-items: baseline; gap: 4px;
  padding: 4px 9px;
  border-radius: 12px;
  background: var(--blue-light);
  white-space: nowrap;
}
.xl-sum-pr-label {
  font-size: 9px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--blue-dark);
}
.xl-sum-pr-val {
  font-size: 12px; font-weight: 700; color: var(--blue-dark);
  font-variant-numeric: tabular-nums;
}
.xl-sum-pr-none {
  background: transparent; color: var(--muted);
  font-size: 12px; font-weight: 600; padding: 4px 6px;
}

/* Empty state (no exercises ever logged). */
.xl-sum-empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
}
.xl-sum-empty-icon { color: var(--muted); opacity: 0.5; margin-bottom: 10px; }
.xl-sum-empty-icon svg { width: 32px; height: 32px; }
.xl-sum-empty-title {
  font-size: 13px; font-weight: 600; color: var(--slate);
}
.xl-sum-empty-sub {
  font-size: 11px; color: var(--muted); margin-top: 4px;
}
