/* Compact gift history and picker; purchase confirmation keeps its own layout. */
html body:has(#asProfile) :is(#userGifts,#exampleModal).pp-gifts-compact.modal {
  padding: 16px !important;
}
html body:has(#asProfile) :is(#userGifts,#exampleModal).pp-gifts-compact .modal-dialog {
  width: 100% !important;
  max-width: 920px !important;
  margin: 0 auto !important;
}
html body:has(#asProfile) :is(#userGifts,#exampleModal).pp-gifts-compact .modal-content {
  display: flex;
  flex-direction: column;
  padding: 16px !important;
  max-height: min(700px,calc(100vh - 32px));
  max-height: min(700px,calc(100dvh - 32px));
  overflow: hidden !important;
}
html body:has(#asProfile) :is(#userGifts,#exampleModal).pp-gifts-compact .modal-header {
  gap: 12px;
  padding: 0 0 10px !important;
  margin: 0 0 12px !important;
  align-items: center;
}
html body:has(#asProfile) :is(#userGifts,#exampleModal).pp-gifts-compact .modal-title {
  min-width: 0;
  height: auto !important;
  font-size: 16px !important;
  font-weight: 700;
  line-height: 1.4 !important;
  white-space: normal;
  overflow-wrap: anywhere;
}
html body:has(#asProfile) :is(#userGifts,#exampleModal).pp-gifts-compact .close2 {
  flex: 0 0 32px;
  width: 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  font-size: 22px !important;
}
html body:has(#asProfile) #userGifts.pp-gifts-compact .userGifts,
html body:has(#asProfile) #exampleModal.pp-gifts-compact .modal-body {
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 0 4px 0 0 !important;
}
html body:has(#asProfile) #userGifts.pp-gifts-compact .userGifts {
  display: grid !important;
  grid-template-columns: repeat(3,minmax(0,1fr));
  align-items: stretch;
  gap: 10px;
}
html body:has(#asProfile) #userGifts.pp-gifts-compact .userGift {
  display: grid !important;
  grid-template-columns: 72px minmax(0,1fr);
  grid-column: auto !important;
  align-items: center;
  align-content: start;
  width: auto !important;
  max-width: none !important;
  min-width: 0;
  margin: 0;
  padding: 10px;
  gap: 8px 10px;
  border-radius: 10px;
}
html body:has(#asProfile) #userGifts.pp-gifts-compact .giftPicture {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  min-width: 0;
  margin: 0;
}
html body:has(#asProfile) #userGifts.pp-gifts-compact .giftPicture img {
  display: block;
  width: 72px !important;
  height: 72px !important;
  padding: 0;
  object-fit: contain;
  border-radius: 8px;
}
html body:has(#asProfile) #userGifts.pp-gifts-compact .senderInfo {
  grid-column: 2;
  grid-row: 1;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 7px;
}
html body:has(#asProfile) #userGifts.pp-gifts-compact .senderInfo > img,
html body:has(#asProfile) #userGifts.pp-gifts-compact .senderInfo > a > img {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  object-fit: cover;
}
html body:has(#asProfile) #userGifts.pp-gifts-compact .senderInfo > a:has(> img) { flex: 0 0 28px; }
html body:has(#asProfile) #userGifts.pp-gifts-compact .sendAuthor { font-size: 13px; line-height: 1.35; }
html body:has(#asProfile) #userGifts.pp-gifts-compact .sendDate { font-size: 11px; line-height: 1.4; padding-top: 3px; }
html body:has(#asProfile) #userGifts.pp-gifts-compact .giftMessage {
  grid-column: 1 / -1;
  text-align: left;
  font-size: 13px;
  line-height: 1.45;
  padding: 0;
  margin: 0;
}
html body:has(#asProfile) #userGifts.pp-gifts-compact .giftMessage:empty { display: none; }
html body:has(#asProfile) #exampleModal.pp-gifts-compact .gifts-row { margin: 0; gap: 6px; }
html body:has(#asProfile) #exampleModal.pp-gifts-compact .category-name { margin: 0; padding: 0; font-size: 13px; line-height: 1.5; }
html body:has(#asProfile) #exampleModal.pp-gifts-compact .gifts-items-container { display: block; min-width: 0; }
html body:has(#asProfile) #exampleModal.pp-gifts-compact .manyElements::after { display: none; }
html body:has(#asProfile) #exampleModal.pp-gifts-compact .gifts-items {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(112px,1fr));
  gap: 8px;
  padding: 0;
  overflow: visible;
}
html body:has(#asProfile) #exampleModal.pp-gifts-compact .gift {
  display: flex;
  align-items: center;
  min-width: 0;
  width: auto;
  padding: 4px 0 0;
  border-radius: 9px !important;
}
html body:has(#asProfile) #exampleModal.pp-gifts-compact .gift img {
  display: block;
  width: 96px;
  height: 96px;
  max-width: 100%;
  padding: 0;
  border-radius: 6px;
  object-fit: contain;
}
html body:has(#asProfile) #exampleModal.pp-gifts-compact .price-overlay {
  position: static !important;
  width: 100%;
  height: 28px;
  min-height: 28px;
  font-size: 13px;
  line-height: 28px;
  text-align: center;
  opacity: 1;
  transform: none;
}
html body:has(#asProfile) #exampleModal.pp-gifts-compact .modal-body hr { margin: 12px 0; }
html body:has(#asProfile) #exampleModal.pp-gifts-compact .pp-gift-category-control {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
}
html body:has(#asProfile) #exampleModal.pp-gifts-compact .pp-gift-category-control label {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}
html body:has(#asProfile) #exampleModal.pp-gifts-compact .pp-gift-category-control select {
  flex: 1;
  min-width: 0;
  max-width: 280px;
  height: 34px !important;
  min-height: 34px !important;
  padding: 4px 30px 4px 10px !important;
  font-size: 13px !important;
}
html body:has(#asProfile) #exampleModal.pp-gifts-compact.pp-gift-categories-ready .gifts-row[hidden],
html body:has(#asProfile) #exampleModal.pp-gifts-compact.pp-gift-categories-ready .category-name,
html body:has(#asProfile) #exampleModal.pp-gifts-compact.pp-gift-categories-ready .gifts-buyList > hr { display: none !important; }
@media (max-width: 760px) {
  html body:has(#asProfile) #userGifts.pp-gifts-compact .userGifts { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 520px) {
  html body:has(#asProfile) :is(#userGifts,#exampleModal).pp-gifts-compact.modal { padding: 10px !important; }
  html body:has(#asProfile) :is(#userGifts,#exampleModal).pp-gifts-compact .modal-content {
    padding: 12px !important;
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
  }
  html body:has(#asProfile) #userGifts.pp-gifts-compact .userGifts { grid-template-columns: minmax(0,1fr); gap: 8px; }
}

/* Category control is aligned independently of the site's global form styles. */
html body:has(#asProfile) #exampleModal.pp-gifts-compact .pp-gift-category-control {
  align-items: center !important;
  gap: 10px;
  margin: 0 0 14px !important;
}
html body:has(#asProfile) #exampleModal.pp-gifts-compact .pp-gift-category-control label {
  display: flex !important;
  align-items: center !important;
  flex: 0 0 auto;
  height: 40px !important;
  min-height: 40px !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 20px !important;
  font-size: 14px !important;
  transform: none !important;
}
html body:has(#asProfile) #exampleModal.pp-gifts-compact .pp-gift-category-trigger {
  display: flex !important;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  max-width: 340px;
  height: 40px !important;
  min-height: 40px !important;
  margin: 0 !important;
  padding: 0 12px !important;
  border: 1px solid var(--pf-border) !important;
  border-radius: 9px !important;
  background-color: var(--pf-panel) !important;
  background-image: var(--pf-fill) !important;
  color: var(--pf-text) !important;
  -webkit-text-fill-color: var(--pf-text) !important;
  font-family: inherit;
  font-weight: 500;
  font-size: 14px !important;
  line-height: 20px !important;
  text-align: left;
  box-shadow: inset 0 1px 0 #ffffff18,0 2px 5px var(--pf-shadow) !important;
  cursor: pointer;
}
html body:has(#asProfile) #exampleModal.pp-gifts-compact .pp-gift-category-trigger:is(:focus-visible,[aria-expanded="true"]) {
  outline: 2px solid var(--pf-accent);
  outline-offset: 2px;
}
html body:has(#asProfile) #exampleModal.pp-gifts-compact .pp-gift-category-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html body:has(#asProfile) #exampleModal.pp-gifts-compact .pp-gift-category-count {
  flex: 0 0 auto;
  min-width: 24px;
  padding: 0 5px;
  border: 1px solid var(--pf-border);
  border-radius: 5px;
  color: var(--pf-muted);
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}
html body:has(#asProfile) #exampleModal.pp-gifts-compact .pp-gift-category-arrow {
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  margin: -4px 2px 0 3px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}
html body:has(#asProfile) #exampleModal.pp-gifts-compact .pp-gift-category-menu {
  position: fixed;
  z-index: 3;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: 6px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--pf-border);
  border-radius: 10px;
  background-color: var(--pf-panel);
  background-image: var(--pf-fill);
  color: var(--pf-text);
  box-shadow: 0 8px 24px var(--pf-shadow);
  pointer-events: auto;
}
html body:has(#asProfile) #exampleModal.pp-gifts-compact .pp-gift-category-menu[hidden] { display: none !important; }
html body:has(#asProfile) #exampleModal.pp-gifts-compact .pp-gift-category-option {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 22px;
  cursor: pointer;
}
html body:has(#asProfile) #exampleModal.pp-gifts-compact .pp-gift-category-option:is(:hover,.is-active) { background: color-mix(in srgb,var(--pf-text) 10%,transparent); }
html body:has(#asProfile) #exampleModal.pp-gifts-compact .pp-gift-category-option[aria-selected="true"] { font-weight: 700; box-shadow: inset 3px 0 0 var(--pf-accent); }
/* Recipient artwork uses the same server-rendered values as the profile header. */
html body:has(#asProfile) :is(#userGifts,#exampleModal).pp-gifts-compact .modal-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; overflow: visible; }
html body:has(#asProfile) .pp-gifts-compact .pp-gift-recipient { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 7px; min-width: 0; }
html body:has(#asProfile) .pp-gifts-compact .pp-gift-recipient-avatar { position: relative; display: inline-flex; flex: 0 0 36px; width: 36px; height: 36px; padding: 3px; }
html body:has(#asProfile) .pp-gifts-compact .pp-gift-recipient-avatar > img { width: 30px; height: 30px; object-fit: cover; border-radius: 50%; }
html body:has(#asProfile) .pp-gifts-compact .pp-gift-recipient-avatar > .pp-gift-recipient-frame { position: absolute; inset: 0; width: 36px; height: 36px; object-fit: contain; border-radius: 0; pointer-events: none; }
html body:has(#asProfile) .pp-gifts-compact .pp-gift-recipient-name { min-width: 0; overflow-wrap: anywhere; -webkit-text-fill-color: currentColor !important; }
html body:has(#asProfile) .pp-gifts-compact .pp-gift-recipient-name[style*="text-fill-color"] { -webkit-text-fill-color: transparent !important; }
html body:has(#asProfile) .pp-gifts-compact .pp-gift-recipient .userBadges { display: inline-flex; align-items: center; gap: 4px; }
html body:has(#asProfile) .pp-gifts-compact .pp-gift-recipient .userBadges img { width: 20px !important; height: 20px !important; max-width: none; object-fit: contain; border-radius: 0; margin: 0; padding: 0; }
/* Three complete gifts in the sidebar. The full history remains under “Все”. */
html body #asProfile .pp-gifts-card .gifts-items {
  display: grid !important;
  grid-template-columns: repeat(3,minmax(0,1fr)) !important;
  gap: 8px !important;
  padding: 0 !important;
  overflow: visible !important;
}
html body #asProfile .pp-gifts-card .gifts-items > .gift { min-width: 0; width: 100%; box-sizing: border-box; }
html body #asProfile .pp-gifts-card .gifts-items > .gift:nth-child(n+4) { display: none !important; }
html body #asProfile .pp-gifts-card .gifts-items > .gift img { display: block; width: 100% !important; height: auto !important; aspect-ratio: 1; box-sizing: border-box; padding: 5px; object-fit: contain; }
html body #asProfile .pp-gifts-card .emptyGifts { grid-column: 1 / -1; }
