#rushd-page-gift-root,
#rushd-page-gift-root *,
#rushd-page-gift-dialog,
#rushd-page-gift-dialog * {
  box-sizing: border-box;
  font-family: "Almarai", sans-serif !important;
}

#rushd-page-gift-root {
  --pg-accent: #d8ad55;
  --pg-accent-soft: #f0cf84;
  --pg-panel: #fffaf1;
  --pg-text: #2d2925;
  --pg-muted: #766a5f;
  position: fixed;
  inset: auto;
  left: var(--pg-fab-left, 18px);
  right: auto;
  top: auto;
  bottom: var(--pg-fab-bottom, calc(12px + env(safe-area-inset-bottom)));
  z-index: 1200;
  pointer-events: none;
}

/* CF1.3.0: approved physical bottom-left anchor in Arabic, English and mobile. */
#rushd-page-gift-root:not([hidden]) {
  left: var(--pg-fab-left, 12px);
  right: auto !important;
  top: auto !important;
  bottom: var(--pg-fab-bottom, calc(12px + env(safe-area-inset-bottom))) !important;
}

.pg-fab {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid rgba(107,65,44,.14);
  border-radius: 999px;
  background-color: #e4bf63;
  background-image: linear-gradient(135deg,#f7dc8d,#e4bf63);
  color: #2d2118;
  box-shadow: 0 8px 22px rgba(82,55,28,.18), inset 0 1px 0 rgba(255,255,255,.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  font-size: 12.5px !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  transition: transform .22s cubic-bezier(.2,.8,.2,1), border-color .22s ease, box-shadow .22s ease, background-color .22s ease;
}

.pg-fab:hover,
.pg-fab:focus-visible {
  transform: translateY(-2px) scale(1.015);
  border-color: rgba(107,65,44,.28);
  background-color: #edca70;
  box-shadow: 0 12px 28px rgba(82,55,28,.22), 0 0 0 3px rgba(240,207,132,.16);
}

.pg-fab:active { transform: translateY(0) scale(.98); }
.pg-fab-icon { display: inline-grid; place-items: center; font-size: 17px !important; transition: transform .24s ease; }
.pg-fab:hover .pg-fab-icon { transform: rotate(-5deg) scale(1.08); }

#rushd-page-gift-root[data-pg-fab-compact="true"] .pg-fab {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  justify-content: center;
  padding: 0;
}
#rushd-page-gift-root[data-pg-fab-compact="true"] .pg-fab-label {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

#rushd-page-gift-dialog {
  position: fixed;
  inset: auto;
  top: var(--pg-popover-top, 12px);
  left: var(--pg-popover-left, 12px);
  width: var(--pg-popover-width, min(296px, calc(100vw - 24px)));
  height: var(--pg-popover-height, min(296px, calc(100dvh - 24px)));
  aspect-ratio: 1 / 1;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: #2d2925;
  overflow: visible;
}

#rushd-page-gift-dialog::backdrop { background: rgba(22,17,14,.42); backdrop-filter: blur(7px); }

.pg-dialog-card {
  --pg-accent: #bf9350;
  position: relative;
  overflow: auto;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  max-height: none;
  padding: 20px 18px 16px;
  border: 1px solid rgba(62,40,29,.16);
  border-radius: 22px;
  background:
    radial-gradient(circle at 90% 8%,rgba(191,147,80,.18),transparent 30%),
    linear-gradient(155deg,#fffaf1,#f2e3cd);
  color: #2d2925;
  box-shadow: 0 24px 72px rgba(22,17,14,.3);
  transform-origin: var(--pg-transform-origin, 50% 100%);
  animation: pg-in .25s cubic-bezier(.2,.8,.2,1) both;
  text-align: center;
}
#pg-dialog-content { display:flex; min-height:100%; flex-direction:column; }

.pg-dialog-card.is-golden {
  --pg-accent: #d7b85d;
  border-color: rgba(226, 193, 95, .78);
  box-shadow: 0 24px 72px rgba(22,17,14,.3), 0 0 32px rgba(215,184,93,.18);
}

@keyframes pg-in { from { opacity: 0; transform: scale(.955) translateY(12px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes pg-out { from { opacity: 1; transform: scale(1) translateY(0); } to { opacity: 0; transform: scale(.955) translateY(12px); } }
#rushd-page-gift-dialog.is-closing .pg-dialog-card { animation: pg-out .22s ease both; }

/* User-approved compact popover: exactly 160px × 160px on the selected Café/Signatures routes. */
#rushd-page-gift-dialog[data-pg-compact160x160="true"] {
  width: var(--pg-popover-width, 160px);
  height: var(--pg-popover-height, 160px);
  aspect-ratio: 1 / 1;
  max-width: min(160px, calc(100vw - 24px));
  max-height: min(160px, calc(100dvh - 24px));
  overflow: hidden;
  border-radius: 14px;
}
#rushd-page-gift-dialog[data-pg-compact160x160="true"]::backdrop {
  background: transparent;
  backdrop-filter: none;
}
#rushd-page-gift-dialog[data-pg-compact160x160="true"] .pg-dialog-card {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  padding: 8px 8px 7px;
  border-radius: 14px;
  box-shadow: 0 24px 72px rgba(22,17,14,.3);
}
#rushd-page-gift-dialog[data-pg-compact160x160="true"] #pg-dialog-content {
  display: grid;
  grid-template-rows: 24px minmax(0,1fr) 30px;
  align-content: stretch;
  min-height: 100%;
  gap: 3px;
}
#rushd-page-gift-dialog[data-pg-compact160x160="true"] .pg-category {
  justify-content: flex-start;
  gap: 4px;
  padding-inline: 3px 25px;
  min-width: 0;
}
#rushd-page-gift-dialog[data-pg-compact160x160="true"] .pg-category-icon {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  font-size: 13px !important;
}
#rushd-page-gift-dialog[data-pg-compact160x160="true"] .pg-category-copy {
  min-width: 0;
  gap: 0;
  text-align: start;
}
#rushd-page-gift-dialog[data-pg-compact160x160="true"] .pg-category-copy small {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}
#rushd-page-gift-dialog[data-pg-compact160x160="true"] .pg-category-copy b {
  display: block;
  overflow: hidden;
  font-size: 12px !important;
  font-weight: 900 !important;
  line-height: 1.4 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#rushd-page-gift-dialog[data-pg-compact160x160="true"] :is(.pg-golden-label,.pg-closing) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}
#rushd-page-gift-dialog[data-pg-compact160x160="true"] .pg-gift-text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  margin: 0;
  padding: 3px 3px 0;
  color: #3e281d;
  font-size: 12px !important;
  font-weight: 800 !important;
  line-height: 1.5 !important;
  text-align: start;
}
#rushd-page-gift-dialog[data-pg-compact160x160="true"] .pg-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin: 0;
  padding: 0;
}
#rushd-page-gift-dialog[data-pg-compact160x160="true"] .pg-action {
  display: grid;
  place-items: center;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 8px;
  font-size: 0 !important;
  line-height: 1 !important;
}
#rushd-page-gift-dialog[data-pg-compact160x160="true"] .pg-action::before { font-size: 14px !important; line-height: 1 !important; }
#rushd-page-gift-dialog[data-pg-compact160x160="true"] .pg-action:nth-child(1)::before { content: "↻"; }
#rushd-page-gift-dialog[data-pg-compact160x160="true"] .pg-action:nth-child(2)::before { content: "⧉"; }
#rushd-page-gift-dialog[data-pg-compact160x160="true"] .pg-action:nth-child(3)::before { content: "↗"; }
#rushd-page-gift-dialog[data-pg-compact160x160="true"] .pg-close {
  inset-block-start: 4px;
  inset-inline-end: 4px;
  width: 25px;
  height: 25px;
  font-size: 16px !important;
  z-index: 2;
}
#rushd-page-gift-dialog[data-pg-compact160x160="true"] .pg-loading {
  grid-row: 1 / -1;
  min-height: 100%;
  padding-inline: 24px;
  font-size: 12px !important;
  line-height: 1.5 !important;
}

/* Approved compact Page Gift: one 180px square popover on every eligible reader page. */
#rushd-page-gift-dialog[data-pg-compact180x180="true"] {
  position: fixed !important;
  inset: auto !important;
  top: var(--pg-popover-top, 12px) !important;
  left: var(--pg-popover-left, 12px) !important;
  width: var(--pg-popover-width, 180px) !important;
  height: var(--pg-popover-height, 180px) !important;
  max-width: min(180px, calc(100vw - 24px)) !important;
  max-height: min(180px, calc(100dvh - 24px)) !important;
  aspect-ratio: 1 / 1 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 16px !important;
  background: transparent !important;
}
#rushd-page-gift-dialog[data-pg-compact180x180="true"]::backdrop {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
#rushd-page-gift-dialog[data-pg-compact180x180="true"] .pg-dialog-card {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  aspect-ratio: 1 / 1 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 8px 8px 7px !important;
  border-radius: 16px !important;
  box-shadow: 0 20px 52px rgba(22,17,14,.28) !important;
}
#rushd-page-gift-dialog[data-pg-compact180x180="true"] #pg-dialog-content {
  display: grid !important;
  grid-template-rows: 26px minmax(0,1fr) 34px !important;
  align-content: stretch !important;
  min-width: 0 !important;
  min-height: 100% !important;
  gap: 4px !important;
  overflow: hidden !important;
}
#rushd-page-gift-dialog[data-pg-compact180x180="true"] .pg-category {
  justify-content: flex-start !important;
  gap: 5px !important;
  min-width: 0 !important;
  padding-inline: 3px 26px !important;
}
#rushd-page-gift-dialog[data-pg-compact180x180="true"] .pg-category-icon {
  flex: 0 0 24px !important;
  width: 24px !important;
  height: 24px !important;
  border-radius: 8px !important;
  font-size: 14px !important;
}
#rushd-page-gift-dialog[data-pg-compact180x180="true"] .pg-category-copy {
  min-width: 0 !important;
  gap: 0 !important;
  text-align: start !important;
}
#rushd-page-gift-dialog[data-pg-compact180x180="true"] .pg-category-copy small,
#rushd-page-gift-dialog[data-pg-compact180x180="true"] :is(.pg-golden-label,.pg-closing) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}
#rushd-page-gift-dialog[data-pg-compact180x180="true"] .pg-category-copy b {
  display: block !important;
  overflow: hidden !important;
  color: #3e281d !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  line-height: 1.45 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
#rushd-page-gift-dialog[data-pg-compact180x180="true"] .pg-gift-text {
  display: -webkit-box !important;
  align-self: center !important;
  overflow: hidden !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 4 !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 4px 3px 0 !important;
  color: #3e281d !important;
  font-size: 12.5px !important;
  font-weight: 800 !important;
  line-height: 1.5 !important;
  overflow-wrap: anywhere !important;
  text-align: center !important;
}
#rushd-page-gift-dialog[data-pg-compact180x180="true"] .pg-actions {
  display: grid !important;
  grid-template-columns: repeat(3,minmax(0,1fr)) !important;
  align-items: stretch !important;
  gap: 4px !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}
#rushd-page-gift-dialog[data-pg-compact180x180="true"] .pg-action {
  display: grid !important;
  place-items: center !important;
  width: auto !important;
  min-width: 0 !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 3px !important;
  overflow: hidden !important;
  border-radius: 9px !important;
  font-size: 10.5px !important;
  font-weight: 900 !important;
  line-height: 1.2 !important;
  text-wrap: balance !important;
}
#rushd-page-gift-dialog[data-pg-compact180x180="true"] .pg-action::before { content: none !important; }
#rushd-page-gift-dialog[data-pg-compact180x180="true"] .pg-close {
  inset-block-start: 5px !important;
  inset-inline-end: 5px !important;
  width: 26px !important;
  height: 26px !important;
  font-size: 17px !important;
  z-index: 2 !important;
}
#rushd-page-gift-dialog[data-pg-compact180x180="true"] .pg-loading {
  grid-row: 1 / -1 !important;
  min-height: 100% !important;
  padding-inline: 24px !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
}

.pg-close {
  position: absolute;
  inset-block-start: 10px;
  inset-inline-end: 10px;
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
  border-radius: 50%;
  background: rgba(255,250,241,.74);
  color: inherit;
  cursor: pointer;
  font-size: 20px !important;
}

.pg-category { display: flex; align-items: center; justify-content:center; gap: 9px; padding-inline: 30px; }
.pg-category-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: rgba(191,147,80,.15); font-size: 19px !important; }
.pg-category-copy { display: grid; gap: 4px; }
.pg-category-copy small { color: #6b412c; font-size: 9.5px !important; font-weight: 800 !important; letter-spacing: .03em; }
.pg-category-copy b { font-size: 13px !important; }
.pg-golden-label { display: inline-flex; width: fit-content; margin: 7px auto 0; padding: 4px 8px; border: 1px solid rgba(226,193,95,.5); border-radius: 999px; color: #6b412c; font-size: 9.5px !important; font-weight: 900 !important; }
.pg-gift-text { margin: 12px 0 7px; color: #3e281d; font-size: 15px !important; font-weight: 800 !important; line-height: 1.65 !important; letter-spacing: 0 !important; }
.pg-closing { margin: 0; color: #766a5f; font-size: 10.5px !important; font-weight: 700 !important; line-height: 1.6 !important; }
.pg-actions { display: grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap: 6px; margin-top: auto; padding-top:10px; }
.pg-action { min-height: 36px; padding: 6px 7px; border: 1px solid rgba(62,40,29,.18); border-radius: 11px; background: rgba(255,250,241,.55); color: #3e281d; cursor: pointer; font-size: 10px !important; font-weight: 800 !important; line-height:1.35 !important; }
.pg-action-primary { background: #223c35; border-color: #223c35; color: #fff; }
.pg-action:hover,.pg-action:focus-visible,.pg-close:hover,.pg-close:focus-visible { outline: none; border-color: var(--pg-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pg-accent) 18%, transparent); }
.pg-loading { min-height: 180px; display: grid; place-items: center; text-align: center; color: color-mix(in srgb, currentColor 74%, transparent); font-size: 14px !important; font-weight: 700 !important; }

.pg-toast {
  position: fixed;
  z-index: 1250;
  inset-inline-start: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 10px 15px;
  border: 1px solid color-mix(in srgb, var(--accent, #c9ae73) 45%, transparent);
  border-radius: 999px;
  background: #10241a;
  color: #fff;
  box-shadow: 0 12px 32px rgba(0,0,0,.35);
  font-size: 12px !important;
  font-weight: 800 !important;
}

@media (max-width: 620px) {
  .pg-fab { min-height: 40px; padding: 8px 12px; }
  .pg-dialog-card { padding:20px 18px 16px; border-radius:22px; }
  .pg-actions { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); }
  .pg-action-primary { grid-column:auto; }
}

@media (prefers-reduced-motion: reduce) {
  #rushd-page-gift-root *, #rushd-page-gift-dialog * { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
