/* The guest sign-up prompt (templates/_guest_prompt.html, _guest_inline.html, _guest_return.html; js/guest-prompt.js).
   Phones: a compact glass sheet floating above the bottom edge (and above the mini player), at most about a quarter of
   the screen. Desktop: a corner card on the inline-end side, clear of the support button. Non-modal: no scrim, the page
   keeps scrolling and playing. Motion: a spring rise; reduced motion and data-motion=0 cross-fade. */

.gp {
  position: fixed; z-index: 60; inset-inline: 8px; inset-block-end: calc(8px + var(--safe-b));
  display: grid; gap: 10px; max-inline-size: 560px; margin-inline: auto; padding: 14px 14px 12px;
  border-radius: 24px; background: var(--mat-card); -webkit-backdrop-filter: var(--mat-blur); backdrop-filter: var(--mat-blur);
  box-shadow: var(--e2), inset 0 0.5px 0 rgb(255 255 255 / 0.35); color: var(--ink);
  opacity: 0; transform: translateY(calc(100% + 24px)) scale(0.98); transform-origin: 50% 100%;
  transition: transform 520ms var(--spring), opacity 220ms var(--ease-out);
}
.gp[hidden] { display: none; }
.gp.is-on { opacity: 1; transform: none; }
.gp-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.gp-mark { display: grid; place-items: center; inline-size: 34px; block-size: 34px; border-radius: 11px; background: var(--tint); color: var(--indigo); }
.gp-mark .ic { inline-size: 18px; block-size: 18px; }
.gp-t { margin: 0; font-family: var(--f-display); font-size: var(--fs-md); font-weight: 750; line-height: 1.45; letter-spacing: -0.005em; text-wrap: balance; }
.gp-l { margin: 0; font-size: var(--fs-sm); line-height: 1.7; color: var(--ink-2); text-wrap: pretty; }
.gp-x { display: grid; place-items: center; inline-size: 44px; block-size: 44px; margin: -6px; margin-inline-start: 0; padding: 0; border: 0;
  border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.gp-x .ic { inline-size: 18px; block-size: 18px; }
.gp-x:hover { background: var(--tint); }
.gp-x:active { transform: scale(0.9); }
.gp-x:focus-visible { outline: 3px solid var(--indigo); outline-offset: -3px; }
.gp-act { display: flex; gap: 8px; align-items: center; }
.gp-go { flex: 1 1 auto; min-block-size: 46px; white-space: nowrap; }
.gp-later { flex: 0 0 auto; min-block-size: 46px; padding-inline: 18px; }

/* free things to explore: secondary, a single swipeable row on phones */
.gp-cards { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: -14px; padding-inline: 14px;
  overscroll-behavior-x: contain; }
.gp-cards::-webkit-scrollbar { display: none; }
.gp-card { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; min-block-size: 48px; max-inline-size: 220px; padding: 6px 12px 6px 10px;
  border-radius: 14px; background: color-mix(in srgb, var(--paper-2) 70%, transparent); color: var(--ink); text-decoration: none; scroll-snap-align: start; }
.gp-card .ic { flex: none; inline-size: 18px; block-size: 18px; color: var(--indigo); }
.gp-card span { display: grid; line-height: 1.35; }
.gp-card b { font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }
.gp-card small { font-size: var(--fs-2xs); color: var(--ink-2); white-space: nowrap; }
.gp-card:active { transform: scale(0.97); }
.gp-card:focus-visible { outline: 3px solid var(--indigo); outline-offset: 2px; }

/* phones: stay clear of the docked mini player, the support button and the end of the page */
@media (max-width: 899.98px) {
  html:has(.mp-mini.on) .gp { inset-block-end: calc(12px + var(--safe-b) + 76px); }
  body.has-tabbar .gp { inset-block-end: calc(var(--tabbar-h) + var(--safe-b) + 8px); }  /* the «ذخیره شد» card of a new member */
  html:has(.mp-mini.on) body.has-tabbar .gp { inset-block-end: calc(var(--tabbar-h) + var(--safe-b) + 82px); }
  html.gp-open .sp-fab { opacity: 0; pointer-events: none; }
  html.gp-open .media-page, html.gp-open main > .page { padding-block-end: 240px; }
}
/* phones: keep the sheet to about a quarter of the screen */
@media (max-width: 899.98px) {
  .gp { gap: 8px; padding: 12px 14px 10px; }
  .gp-mark { display: none; }
  .gp-head { grid-template-columns: 1fr auto; }
  .gp-t { font-size: var(--fs-base); line-height: 1.5; }
  .gp-l { font-size: var(--fs-xs); line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .gp-go, .gp-later { min-block-size: 44px; }
  .gp-card { min-block-size: 40px; padding-block: 4px; }
  .gp-card small { display: none; }
}
@media (max-width: 899.98px) and (max-height: 700px) { .gp-cards { display: none; } }

/* desktop: a corner card on the inline-end side (the support button sits on the start side) */
@media (min-width: 900px) {
  .gp { inset-inline-start: auto; inset-inline-end: 24px; inset-block-end: 24px; inline-size: 380px; margin: 0; padding: 18px 18px 14px;
    transform: translateY(16px) scale(0.96); transform-origin: 0 100%; }
  :root[dir="ltr"] .gp { transform-origin: 100% 100%; }
  .gp-cards { flex-direction: column; gap: 2px; overflow: visible; margin: 2px -8px 0; padding: 6px 0 0; border-block-start: 0.5px solid var(--sep); }
  .gp-card { max-inline-size: none; min-block-size: 40px; padding: 4px 8px; background: transparent; }
  .gp-card:hover { background: var(--tint); }
  .gp-card span { display: flex; gap: 8px; align-items: baseline; }
  .gp-card b { font-size: var(--fs-sm); font-weight: 650; }
}

/* back from signing up: a status card under the header on phones (like the site's toasts), clear of the player's
   controls and the tab bar; the corner card on desktop */
.gp-ok .gp-mark { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
@media (max-width: 899.98px) {
  .gp.gp-ok, body.has-tabbar .gp.gp-ok, html:has(.mp-mini.on) body.has-tabbar .gp.gp-ok {
    inset-block: calc(var(--header-h) + var(--safe-t) + 8px) auto; transform-origin: 50% 0; }
}

/* the header chip «ذخیره‌ی پیشرفت»: quiet, not a primary button */
.gp-chip { background: var(--tint); color: var(--indigo); gap: 6px; font-weight: 650; }
.gp-chip .ic { inline-size: 16px; block-size: 16px; }
.gp-chip { padding-inline: 12px; }
/* phones: the chip takes the language pill's place (the menu keeps the language switch), so the header never overflows */
@media (max-width: 429.98px) { .nav-actions:has(.gp-chip) .lang-pill-form { display: none; } }
@media (max-width: 339.98px) { .gp-chip span { display: none; } }

/* inline nudges */
.gp-inline { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0 0; padding: 10px 12px; border-radius: 14px;
  background: var(--tint); color: var(--ink); font-size: var(--fs-sm); line-height: 1.75; }
.gp-inline > .ic { flex: none; inline-size: 18px; block-size: 18px; margin-block-start: 4px; color: var(--indigo); }
.gp-inline a { font-weight: 700; color: var(--indigo); white-space: nowrap; }
.gp-lock-ic { display: inline-grid; margin-inline-start: 4px; opacity: 0.7; }
.gp-lock-ic .ic { inline-size: 13px; block-size: 13px; }
.gp-strip { display: block; margin-block: 0 14px; padding: 0; }
.gp-strip summary { display: flex; align-items: center; gap: 8px; min-block-size: 44px; padding-inline: 12px; cursor: pointer; font-weight: 700; color: var(--indigo); list-style: none; }
.gp-strip summary::-webkit-details-marker { display: none; }
.gp-strip summary > span { flex: 1; }
.gp-strip .gp-chev { transition: transform var(--dur-2) var(--ease-out); }
.gp-strip[open] .gp-chev { transform: rotate(180deg); }
.gp-strip ul { margin: 0; padding-block: 0 4px; padding-inline: 34px 12px; }
.gp-strip li { margin-block: 2px; }
.gp-strip .btn { margin: 4px 12px 12px; }

@media (prefers-reduced-motion: reduce) {
  .gp, .gp.is-on { transform: none; transition: opacity var(--dur-2) ease; }
}
html[data-motion="0"] .gp, html[data-motion="0"] .gp.is-on { transform: none; transition: opacity var(--dur-2) ease; }
@media (prefers-reduced-transparency: reduce) { .gp { background: var(--card); -webkit-backdrop-filter: none; backdrop-filter: none; } }
@media (prefers-contrast: more) { .gp { background: var(--card); box-shadow: 0 0 0 1.5px var(--ink); } }
@media (forced-colors: active) { .gp { border: 1px solid CanvasText; } }
