body.saved-library-page {
  --bookmark-card: color-mix(in srgb, var(--card, #fff) 96%, var(--bg, #f8fafc));
  --bookmark-soft: color-mix(in srgb, var(--bg, #f8fafc) 76%, var(--card, #fff));
  --bookmark-line: color-mix(in srgb, var(--line, #d9dde3) 82%, transparent);
  --bookmark-accent-soft: color-mix(in srgb, var(--accent, #1877f2) 12%, var(--card, #fff));
  --bookmark-shadow: 0 16px 38px color-mix(in srgb, var(--text, #0f172a) 10%, transparent);
  --bookmark-shadow-soft: 0 10px 24px color-mix(in srgb, var(--text, #0f172a) 7%, transparent);
}

body.saved-library-page .saved-library-card {
  display: grid;
  gap: 16px;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

body.saved-library-page .bookmark-library-hero {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 20px !important;
  border: 1px solid var(--bookmark-line) !important;
  border-radius: 22px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--bookmark-card) 96%, var(--accent, #1877f2)), var(--bookmark-card));
  box-shadow: var(--bookmark-shadow-soft);
}

body.saved-library-page .bookmark-library-hero-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

body.saved-library-page .bookmark-library-kicker {
  color: var(--accent, #1877f2);
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .08em;
}

body.saved-library-page .bookmark-library-hero h1 {
  margin: 0 !important;
  color: var(--text, #0f172a);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1;
}

body.saved-library-page .bookmark-library-hero p {
  max-width: 620px;
  margin: 0;
  color: var(--muted, #64748b);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.35;
}

body.saved-library-page .bookmark-library-hero .page-meta-muted {
  color: var(--muted, #64748b);
  font-size: 13px;
  font-weight: 850;
}

body.saved-library-page .bookmark-search-open-btn {
  min-height: 42px !important;
  padding: 0 16px !important;
  border: 1px solid color-mix(in srgb, var(--accent, #1877f2) 34%, transparent) !important;
  border-radius: 14px !important;
  background: var(--accent, #1877f2) !important;
  color: #fff !important;
  box-shadow: 0 12px 24px color-mix(in srgb, var(--accent, #1877f2) 24%, transparent) !important;
  font-size: 13px !important;
  font-weight: 950 !important;
}

body.saved-library-page .bookmark-library-stats {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

body.saved-library-page .bookmark-library-stats > * {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--bookmark-line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--card, #fff) 78%, transparent);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--text, #0f172a) 5%, transparent);
}

body.saved-library-page .bookmark-library-stats > *.is-active {
  border-color: color-mix(in srgb, var(--accent, #1877f2) 48%, var(--line, #d9dde3));
  background: var(--bookmark-accent-soft);
}

body.saved-library-page .bookmark-library-stats strong {
  color: var(--text, #0f172a);
  font-size: 22px;
  line-height: 1;
}

body.saved-library-page .bookmark-library-stats span span,
body.saved-library-page .bookmark-library-stats a span {
  color: var(--muted, #64748b);
  font-size: 12px;
  font-weight: 900;
}

body.saved-library-page .bookmark-library-tabs {
  display: inline-flex !important;
  width: max-content;
  max-width: 100%;
  gap: 6px !important;
  padding: 6px;
  border: 1px solid var(--bookmark-line);
  border-radius: 16px;
  background: var(--bookmark-soft);
  box-shadow: none;
}

body.saved-library-page .bookmark-library-tabs .profile-tab {
  min-height: 36px;
  padding: 0 16px;
  border-radius: 12px;
  font-weight: 950;
}

body.saved-library-page .bookmark-posts-grid,
body.saved-library-page .saved-page-grid {
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)) !important;
  gap: 18px !important;
}

body.saved-library-page .saved-page-card {
  padding: 14px !important;
  border: 1px solid var(--bookmark-line) !important;
  border-radius: 20px !important;
  background: var(--bookmark-card) !important;
  box-shadow: var(--bookmark-shadow-soft) !important;
}

body.saved-library-page .saved-page-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--bookmark-shadow) !important;
}

body.saved-library-page .saved-card-head {
  display: grid !important;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px !important;
  align-items: center !important;
}

body.saved-library-page .saved-post-avatar-link {
  display: block;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  border-radius: 999px;
  overflow: hidden;
  background: var(--bookmark-soft);
  box-shadow: 0 0 0 2px var(--card, #fff), 0 8px 16px color-mix(in srgb, var(--text, #0f172a) 12%, transparent);
}

body.saved-library-page .saved-post-avatar {
  display: block !important;
  width: 36px !important;
  height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  object-fit: cover !important;
  border-radius: 999px !important;
}

body.saved-library-page .saved-card-author-line {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

body.saved-library-page .saved-card-author-line a {
  min-width: 0;
  overflow: hidden;
  color: var(--text, #0f172a);
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.saved-library-page .saved-card-author-line span {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--bookmark-accent-soft);
  color: var(--accent, #1877f2);
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

body.saved-library-page .saved-card-bookmarked,
body.saved-library-page .saved-page-card .meta-username {
  color: var(--muted, #64748b) !important;
  font-size: 12px;
  font-weight: 800;
}

body.saved-library-page .saved-card-content {
  color: var(--text, #0f172a);
  font-size: 14px;
  line-height: 1.45;
}

body.saved-library-page .saved-card-media-grid,
body.saved-library-page .saved-page-card .media-grid {
  gap: 7px !important;
}

body.saved-library-page .saved-card-media-item,
body.saved-library-page .saved-page-card .media-grid-item {
  border: 1px solid var(--bookmark-line);
  border-radius: 16px !important;
  background: var(--bookmark-soft) !important;
}

body.saved-library-page .saved-card-actions {
  align-items: center !important;
  justify-content: space-between !important;
}

body.saved-library-page .post-permalink-link {
  color: var(--accent, #1877f2) !important;
  font-weight: 950;
}

body.saved-library-page .bookmark-toggle-btn {
  min-height: 34px !important;
  padding: 0 12px !important;
  border: 1px solid var(--bookmark-line) !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--card, #fff) 74%, var(--bg, #f8fafc)) !important;
  color: var(--text, #0f172a) !important;
  box-shadow: none !important;
  font-size: 12px !important;
  font-weight: 950 !important;
}

body.saved-library-page .bookmark-toggle-btn.is-bookmarked {
  border-color: color-mix(in srgb, var(--accent, #1877f2) 38%, var(--line, #d9dde3)) !important;
  background: var(--bookmark-accent-soft) !important;
  color: var(--accent, #1877f2) !important;
}

body.saved-library-page .bookmarked-profile-card {
  border: 1px solid var(--bookmark-line) !important;
  border-radius: 20px !important;
  background: var(--bookmark-card) !important;
  box-shadow: var(--bookmark-shadow-soft) !important;
}

body.saved-library-page .bookmarked-profile-body {
  padding: 15px !important;
}

body.saved-library-page .bookmarked-profile-avatar {
  width: 62px !important;
  height: 62px !important;
  max-width: 62px !important;
  max-height: 62px !important;
}

body.saved-library-page .empty-state {
  border: 1px dashed color-mix(in srgb, var(--line, #d9dde3) 84%, var(--accent, #1877f2));
  border-radius: 20px;
  background: var(--bookmark-soft);
  color: var(--muted, #64748b);
  font-weight: 900;
}

body.saved-library-page .bookmark-search-dialog {
  background: var(--bookmark-card) !important;
  color: var(--text, #0f172a) !important;
}

body.saved-library-page .bookmark-search-result {
  border-color: var(--bookmark-line) !important;
  background: var(--bookmark-soft) !important;
  color: var(--text, #0f172a) !important;
}

@media (max-width: 760px) {
  body.saved-library-page .bookmark-library-hero {
    grid-template-columns: 1fr;
    padding: 16px !important;
  }

  body.saved-library-page .bookmark-search-open-btn {
    width: 100%;
  }

  body.saved-library-page .bookmark-library-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.saved-library-page .bookmark-library-tabs {
    width: 100%;
  }

  body.saved-library-page .bookmark-library-tabs .profile-tab {
    flex: 1 1 0;
    text-align: center;
  }

  body.saved-library-page .bookmark-posts-grid,
  body.saved-library-page .saved-page-grid,
  body.saved-library-page .bookmarked-profile-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  body.saved-library-page .saved-card-head {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  body.saved-library-page .saved-card-main-toggle {
    grid-column: 1 / -1;
    justify-self: start;
  }

  body.saved-library-page .saved-post-avatar-link,
  body.saved-library-page .saved-post-avatar {
    width: 34px !important;
    height: 34px !important;
    max-width: 34px !important;
    max-height: 34px !important;
  }
}
