/* The header stays reachable while a long collection scrolls inside the dialog. */
.modern-site .favorites-dialog.cs-fav-panel {
  box-sizing: border-box;
  width: min(944px, calc(100% - 32px));
  max-width: none;
  max-height: min(88vh, 920px);
  max-height: min(88dvh, 920px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  color: var(--ui-ink);
  background: var(--ui-surface);
  box-shadow: 0 22px 80px rgb(0 0 0 / 35%);
  font-family: var(--cs16-font, inherit);
  text-align: start;
}
.cs-fav-panel[open] { display: flex; flex-direction: column; }
.cs-fav-panel:not([open]), .cs-fav-panel [hidden] { display: none !important; }
.cs-fav-panel::backdrop { background: rgb(9 18 22 / 74%); backdrop-filter: blur(3px); }
.modern-site .cs-fav-panel.favorites-fallback {
  position: fixed;
  inset: 0;
  height: fit-content;
  transform: none;
  z-index: 10000;
  box-shadow: 0 0 0 100vmax rgb(9 18 22 / 74%);
}
.cs-fav-panel :where(*, *::before, *::after) { box-sizing: border-box; }
.cs-fav-panel :is(h2,h3,p) { margin: 0; }
.cs-fav-panel svg {
  display: block;
  flex: none;
  width: 18px;
  height: 18px;
}
.cs-fav-panel .cs-fav-heading {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px clamp(15px, 3vw, 28px);
  border-bottom: 1px solid var(--ui-line);
  background: var(--ui-surface);
}
.cs-fav-panel .cs-fav-heading h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ui-ink);
  font-size: clamp(22px, 3vw, 29px);
  line-height: 1.14;
  font-weight: 750;
  letter-spacing: -.035em;
}
.cs-fav-count {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  padding: 4px 7px;
  border-radius: 7px;
  color: var(--ui-accent);
  background: var(--ui-tint);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.cs-fav-panel .cs-fav-heading p {
  margin-top: 4px;
  color: var(--ui-muted);
  font-size: 12px;
  line-height: 1.4;
}
.cs-fav-scroll {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 18px clamp(15px, 3vw, 28px) 24px;
  background: var(--ui-soft);
}
.cs-fav-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.cs-fav-panel .cs-fav-field {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  margin: 0;
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
}
.cs-fav-panel .cs-fav-field :is(input,select) {
  display: block;
  width: 100%;
  min-width: 0;
  height: 43px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid var(--ui-line);
  border-radius: 9px;
  background-color: var(--ui-surface);
  color: var(--ui-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
}
.cs-fav-panel .cs-fav-field select { appearance: auto; }
.cs-fav-search__input { position: relative; display: block; }
.cs-fav-search__input svg {
  position: absolute;
  inset: 50% auto auto 12px;
  transform: translateY(-50%);
  pointer-events: none;
  width: 16px;
  height: 16px;
}
.cs-fav-panel .cs-fav-search input { padding-inline-start: 36px; }
.cs-fav-panel .cs-fav-search input::placeholder { color: var(--ui-muted); opacity: 1; }
.cs-fav-panel .cs-fav-status:not(:empty) {
  margin: 0 0 12px;
  color: var(--ui-muted);
  font-size: 13px;
  line-height: 1.45;
}
.cs-fav-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 16px;
}
.cs-fav-panel .cs-fav-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow);
}
.cs-fav-card__media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--ui-soft);
}
.cs-fav-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cs-fav-card__body {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  padding: 16px;
}
.cs-fav-card__tags, .cs-fav-card__stats, .cs-fav-card__actions, .cs-fav-card__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.cs-fav-card__tags:not(:has(> :not([hidden]))),
.cs-fav-card__stats:not(:has(> :not([hidden]))) { display: none; }
.cs-fav-card__tags > span {
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 5px;
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.3;
  font-weight: 650;
}
.cs-fav-card__type { color: var(--ui-accent); background: var(--ui-tint); }
.cs-fav-card__game { color: var(--ui-muted); background: var(--ui-soft); }
.cs-fav-panel .cs-fav-card__title {
  color: var(--ui-ink);
  font-size: clamp(17px, 2vw, 20px);
  font-weight: 720;
  line-height: 1.28;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}
.cs-fav-panel .cs-fav-card__title a { color: inherit; text-decoration: none; }
.cs-fav-panel .cs-fav-card__title a:hover { color: var(--ui-accent); text-decoration: underline; }
.cs-fav-panel .cs-fav-card__desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
  color: var(--ui-muted);
  font-size: 14px;
  line-height: 1.5;
}
.cs-fav-panel .cs-fav-card__stats {
  gap: 4px 12px;
  margin-top: auto;
  padding-top: 3px;
  color: var(--ui-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}
.cs-fav-card__stats > span { display: inline-flex; align-items: center; gap: 4px; }
.cs-fav-card__stats svg { width: 14px; height: 14px; }
.cs-fav-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border-top: 1px solid var(--ui-line);
}
.cs-fav-card__tools { margin-inline-start: auto; }
.cs-fav-panel :is(.cs-fav-button,.cs-fav-icon-button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin-block: 0;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: var(--ui-soft);
  color: var(--ui-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.cs-fav-panel .cs-fav-button { padding: 7px 10px; }
.cs-fav-panel .cs-fav-icon-button { width: 38px; height: 38px; padding: 0; flex: none; }
.cs-fav-panel .cs-fav-icon-button svg { width: 17px; height: 17px; }
.cs-fav-panel .cs-fav-button--download { border-color: transparent; background: var(--ui-action); color: var(--ui-on-action); }
.cs-fav-panel :is(.cs-fav-button,.cs-fav-icon-button):hover { border-color: var(--ui-accent); }
.cs-fav-panel :is(a,button,select,input):focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 2px; }
.cs-fav-panel .cs-fav-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: clamp(24px, 6vw, 54px) 18px;
  border: 1px dashed var(--ui-line);
  border-radius: 14px;
  background: var(--ui-surface);
  color: var(--ui-muted);
  text-align: center;
}
.cs-fav-panel .cs-fav-empty__icon {
  box-sizing: content-box;
  width: 23px;
  height: 23px;
  padding: 12px;
  border-radius: 12px;
  background: var(--ui-tint);
  color: var(--ui-accent);
}
.cs-fav-panel .cs-fav-empty h3 { color: var(--ui-ink); font-size: 18px; line-height: 1.3; }
.cs-fav-panel .cs-fav-empty p { max-width: 37ch; font-size: 14px; line-height: 1.45; }
.cs-fav-panel .cs-fav-more { display: flex; margin: 18px auto 0; }
.cs-fav-panel .cs-fav-retry { margin-bottom: 12px; }
.cs-fav-panel .cs-fav-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 680px) {
  .modern-site .favorites-dialog.cs-fav-panel {
    width: calc(100% - 16px);
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
  }
  .cs-fav-panel .cs-fav-heading { padding: 12px; }
  .cs-fav-scroll { padding: 12px; }
  .cs-fav-toolbar { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .cs-fav-search { grid-column: 1 / -1; }
  .cs-fav-panel .cs-fav-field input { font-size: 16px; }
  .cs-fav-grid { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .cs-fav-card__body { padding: 13px; }
  .cs-fav-panel :is(.cs-fav-button,.cs-fav-icon-button) { min-height: 44px; }
  .cs-fav-panel .cs-fav-icon-button { width: 44px; }
}
@media (max-width: 359px) {
  .cs-fav-card__foot { padding-inline: 8px; }
  .cs-fav-card__actions, .cs-fav-card__tools { gap: 4px; }
  .cs-fav-panel .cs-fav-card__actions .cs-fav-button { padding-inline: 7px; }
}
