/* Favorites list on the search results page: reuses flow buttons and shared training cards. */
.flow-favorites-toggle { gap: 7px; }
.flow-favorites-toggle__icon { color: var(--flow-blue); font-size: 15px; line-height: 1; }
.flow-favorites-toggle__count { display: inline-grid; min-width: 22px; height: 22px; place-items: center; padding: 0 6px; border-radius: 999px; color: var(--flow-blue); background: var(--c-surface-muted); font-size: 12px; line-height: 1; }
.flow-favorites-toggle.is-active { border-color: var(--flow-blue); color: var(--flow-blue); background: var(--c-bg); }

.flow-favorites { margin: 0 0 22px; padding: 20px 22px 22px; border: 1px solid var(--flow-border); border-radius: 14px; background: var(--flow-card); box-shadow: var(--flow-shadow); scroll-margin-top: 88px; }
.flow-favorites[hidden] { display: none; }
.flow-favorites__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.flow-favorites__head h2 { display: flex; align-items: baseline; gap: 10px; margin: 0; font-size: 18px; line-height: 1.4; }
.flow-favorites__head h2 span { color: var(--flow-muted); font-size: 13px; font-weight: 700; }
.flow-favorites__head h2:focus { outline: none; }
.flow-favorites__head h2:focus-visible { outline: 3px solid rgba(55, 85, 113, .24); outline-offset: 3px; border-radius: 4px; }
.flow-favorites__close { min-height: 38px; flex: 0 0 auto; padding: 0 14px; }
.flow-favorites__cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.flow-favorites__empty { margin: 0; padding: 32px 20px; }

@media (max-width: 767px) {
  body[data-flow-page="results"] .flow-toolbar { justify-content: flex-end; }
  /* The empty-chip placeholder is already hidden on mobile; drop its reserved width so both buttons share one row. */
  body[data-flow-page="results"] .flow-toolbar__chips:has(> .flow-chip--empty) { display: none; }
  /* Selected condition chips get their own row so the two action buttons stay together below them. */
  body[data-flow-page="results"] .flow-toolbar__chips { flex-basis: 100%; }
  body[data-flow-page="results"] .flow-favorites-toggle { width: auto; min-height: 39px; flex: 0 0 auto; padding: 0 11px; border-radius: 9px; font-size: 12px; }
  body[data-flow-page="results"] .flow-favorites { order: 2; margin: 0 0 12px; padding: 14px 12px; scroll-margin-top: 72px; }
  body[data-flow-page="results"] .flow-favorites__head { margin-bottom: 12px; }
  body[data-flow-page="results"] .flow-favorites__head h2 { font-size: 16px; }
  body[data-flow-page="results"] .flow-favorites__cards { grid-template-columns: 1fr; gap: 10px; }
}
