/* ── Tier Gate System ───────────────────────────────────────────────────────
   Pattern A: .gate-banner  — horizontal bar, inline within a larger page
   Pattern B: .ps-gate-scene — full-page blur + overlay card
   ─────────────────────────────────────────────────────────────────────────── */

/* ── Pattern A: Banner ─────────────────────────────────────────────────── */
.gate-banner {
  display: none;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 24px;
  border: 1px solid rgba(59,142,240,0.18);
  background: linear-gradient(135deg, var(--blue-d) 0%, var(--form-bg) 100%);
}
.gate-banner.show { display: flex; }

.gate-banner-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.gate-banner-icon { background: var(--form-input, rgba(0,0,0,0.06)); color: var(--t2); }

.gate-banner-main { flex: 1; min-width: 180px; }
.gate-banner-main strong { font-size: 0.92rem; color: var(--t1); display: block; margin-bottom: 4px; font-family: var(--fb); font-weight: 700; }
.gate-banner-main p { font-size: 0.82rem; color: var(--t2); margin: 0; line-height: 1.5; }

/* Near-tier copy toggle */
.gate-banner-near-text { display: none; }
.gate-banner.ps-gate-near .gate-banner-near-text { display: block; }
.gate-banner.ps-gate-near .gate-banner-default-text { display: none; }

.gate-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.gate-banner-btn {
  background: var(--cta-bg);
  color: var(--cta-text);
  border: none;
  border-radius: 8px;
  padding: 9px 20px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--fb);
  transition: all 0.2s;
  white-space: nowrap;
}
.gate-banner-btn:hover { background: var(--cta-hover); box-shadow: 0 4px 16px var(--cta-shadow); }
.gate-banner-link {
  font-size: 0.82rem;
  color: var(--t3);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--fb);
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: color 0.15s, text-decoration-color 0.15s;
  padding: 0;
}
.gate-banner-link:hover { color: var(--t2); text-decoration-color: var(--t3); }

/* ── Pattern B: Scene (blur + overlay) ─────────────────────────────────── */
.ps-gate-scene {
  position: relative;
  min-height: 480px;
}

/* Blur all direct children except the overlay */
.ps-gate-blocked > *:not(.ps-gate-overlay) {
  filter: blur(3px);
  pointer-events: none;
  user-select: none;
  opacity: 0.65;
  transition: filter 0.25s, opacity 0.25s;
}

/* Overlay — fixed, starts after the 232px sidebar so nav stays clickable */
.ps-gate-overlay {
  display: none;
  position: fixed;
  top: 0; right: 0; bottom: 0;
  left: 232px;
  z-index: 199;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}
.ps-gate-blocked .ps-gate-overlay { display: flex; }
@media (max-width: 768px) {
  .ps-gate-overlay { left: 0; }
}

/* Gate card — one style, no tier variants */
.ps-gate-card {
  background: var(--form-bg);
  border: 1px solid var(--b1);
  border-radius: 20px;
  padding: 36px 32px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.09);
  position: relative;
}

/* Icon badge */
.ps-gate-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: var(--form-input, rgba(0,0,0,0.06));
  color: var(--t2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

/* Tier pill */
.ps-gate-tier-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 16px;
  background: var(--form-input, rgba(0,0,0,0.06));
  color: var(--t3);
}

/* Copy */
.ps-gate-headline {
  font-family: var(--fd);
  font-size: 1.22rem;
  font-weight: 800;
  color: var(--t1);
  margin-bottom: 10px;
  line-height: 1.3;
}
.ps-gate-body {
  font-size: 0.875rem;
  color: var(--t2);
  line-height: 1.6;
  margin-bottom: 24px;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

/* Near-tier copy toggle */
.ps-gate-near-copy { display: none; }
.ps-gate-blocked.ps-gate-near .ps-gate-near-copy { display: block; }
.ps-gate-blocked.ps-gate-near .ps-gate-default-copy { display: none; }

/* Actions */
.ps-gate-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.ps-gate-primary {
  background: var(--cta-bg);
  color: var(--cta-text);
  border: none;
  border-radius: 10px;
  padding: 13px 28px;
  font-size: 0.93rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--fb);
  transition: opacity 0.18s;
  width: 100%;
}
.ps-gate-primary:hover { opacity: 0.88; }

.ps-gate-secondary {
  font-size: 0.82rem;
  color: var(--t3);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--fb);
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: color 0.15s, text-decoration-color 0.15s;
  padding: 0;
}
.ps-gate-secondary:hover { color: var(--t2); text-decoration-color: var(--t3); }

/* ── Usage-limit inline message ─────────────────────────────────────────── */
.usage-limit-msg {
  display: none;
  background: var(--amber-d);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 12px;
  padding: 14px 18px;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--amber);
}
.usage-limit-msg.show { display: block; }

/* ── Legacy stubs (backwards compat) ───────────────────────────────────── */
.gate-modal-wrap { display: none; padding: 48px 24px; text-align: center; }
.gate-modal-wrap.show { display: block; }
.gate-modal { background: var(--form-bg); border: 1px solid var(--b1); border-radius: 18px; padding: 40px 32px; max-width: 520px; margin: 0 auto; box-shadow: var(--sh-md); }
.gate-icon { width: 64px; height: 64px; background: var(--amber-d); border-radius: 18px; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; color: var(--amber); }
.gate-title { font-family: var(--fd); font-size: 1.2rem; font-weight: 800; color: var(--t1); margin-bottom: 10px; }
.gate-desc { font-size: 0.88rem; color: var(--t2); line-height: 1.6; margin-bottom: 24px; max-width: 380px; margin-left: auto; margin-right: auto; }
.gate-btn { background: var(--cta-bg); border: none; border-radius: 10px; padding: 12px 28px; color: var(--cta-text); font-size: 0.95rem; font-weight: 700; cursor: pointer; font-family: var(--fb); }
.gate-btn:hover { opacity: 0.88; }
