/* Plex IPTV Sales Tools. Uses the theme's design tokens, with fallbacks. */
.pxst-picker,
.pxst-chat,
.pxst-popup,
.pxst-toast,
.pxst-teaser,
.pxst-ref {
  --pxst-bg: var(--bg-elevated, #0f1522);
  --pxst-card: var(--card, #131a2a);
  --pxst-card2: var(--card-hover, #172036);
  --pxst-border: var(--border, rgba(255, 255, 255, 0.08));
  --pxst-border2: var(--border-strong, rgba(255, 255, 255, 0.14));
  --pxst-text: var(--text, #f2f5ff);
  --pxst-muted: var(--muted, #9aa4c0);
  --pxst-accent: var(--accent, #7c5cff);
  --pxst-accent-soft: var(--accent-soft, rgba(124, 92, 255, 0.14));
  --pxst-cyan: var(--cyan, #22d3ee);
  --pxst-wa: var(--wa, #25d366);
  --pxst-wa-text: var(--wa-text, #0b0f1a);
  --pxst-gold: var(--gold, #ffb020);
  font-family: var(--font-body, Inter, system-ui, sans-serif);
  color: var(--pxst-text);
}

/* ---------- Buttons ---------- */
.pxst-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: var(--radius-btn, 12px);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none !important;
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s;
}
.pxst-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}
.pxst-btn--wa {
  background: var(--pxst-wa);
  color: var(--pxst-wa-text) !important;
}
.pxst-btn--ghost {
  border: 1px solid var(--pxst-border2);
  color: var(--pxst-text) !important;
  background: transparent;
}
.pxst-btn--sm {
  min-height: 38px;
  padding: 8px 14px;
  font-size: 0.875rem;
  margin: 8px 6px 0 0;
}
.pxst-btn--lg {
  width: 100%;
  min-height: 52px;
  font-size: 1.02rem;
}
.pxst-link {
  background: none;
  border: 0;
  padding: 8px 0;
  color: var(--pxst-cyan, #22d3ee);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}
.pxst-link:hover {
  text-decoration: underline;
}

/* ---------- Plan picker ---------- */
.pxst-picker {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 32px);
  background: var(--pxst-card);
  border: 1px solid var(--pxst-border2);
  border-radius: var(--radius-card, 20px);
}
.pxst-picker__title {
  margin: 0 0 4px;
  font-family: var(--font-head, inherit);
  font-size: clamp(1.35rem, 1.2rem + 0.8vw, 1.7rem);
  font-weight: 800;
}
.pxst-picker__sub,
.pxst-picker__step {
  margin: 0;
  color: var(--pxst-muted);
  font-size: 0.9rem;
}
.pxst-picker__head {
  margin-bottom: 18px;
}
.pxst-picker__step {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--pxst-cyan);
}
.pxst-picker__q {
  margin: 6px 0 14px;
  font-size: 1.1rem;
  font-weight: 700;
}
.pxst-picker__note {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--pxst-accent-soft);
  font-size: 0.9rem;
}
.pxst-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}
.pxst-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--pxst-border2);
  border-radius: 14px;
  background: var(--pxst-bg);
  color: var(--pxst-text) !important;
  font: inherit;
  text-align: left;
  text-decoration: none !important;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.pxst-choice:hover,
.pxst-choice:focus-visible {
  border-color: var(--pxst-accent);
  background: var(--pxst-accent-soft);
  transform: translateY(-1px);
}
.pxst-choice__label {
  font-weight: 700;
}
.pxst-choice__sub {
  color: var(--pxst-muted);
  font-size: 0.85rem;
}
.pxst-choice--wa {
  border-style: dashed;
}

/* Result card (picker and chat) */
.pxst-result {
  margin: 4px 0 12px;
  padding: 18px;
  border: 1px solid rgba(37, 211, 102, 0.45);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(37, 211, 102, 0.08), transparent 60%), var(--pxst-bg);
}
.pxst-result__eyebrow {
  margin: 0;
  color: var(--pxst-wa);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pxst-result__title {
  margin: 4px 0 2px;
  font-family: var(--font-head, inherit);
  font-size: 1.2rem;
  font-weight: 800;
}
.pxst-result__price {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
}
.pxst-result__price span {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--pxst-muted);
}
.pxst-result__save {
  display: inline-block;
  margin: 8px 0 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 176, 32, 0.15);
  color: var(--pxst-gold);
  font-size: 0.85rem;
  font-weight: 700;
}
.pxst-result__list {
  margin: 12px 0 14px;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
}
.pxst-result__list li {
  position: relative;
  padding: 3px 0 3px 22px;
}
.pxst-result__list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--pxst-wa);
  font-weight: 800;
}
.pxst-result .pxst-btn--wa {
  width: 100%;
}
.pxst-result__tip {
  margin: 10px 0 0;
  color: var(--pxst-muted);
  font-size: 0.85rem;
}

.pxst-compare {
  margin: 6px 0;
}
.pxst-compare summary {
  cursor: pointer;
  color: var(--pxst-cyan);
  font-size: 0.9rem;
  padding: 6px 0;
}
.pxst-table {
  width: 100%;
  margin: 8px 0;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.pxst-table th,
.pxst-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--pxst-border);
  text-align: left;
}
.pxst-table th {
  color: var(--pxst-muted);
  font-weight: 600;
}
.pxst-table tr.is-hl td {
  background: var(--pxst-accent-soft);
  font-weight: 700;
}

/* ---------- Chat launcher, teaser and panel ---------- */
.pxst-launch {
  position: fixed;
  z-index: 95;
  bottom: calc(var(--bottom-bar-h, 0px) + 14px + env(safe-area-inset-bottom, 0px));
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent, #7c5cff), var(--cyan, #22d3ee));
  box-shadow: 0 12px 28px -8px rgba(124, 92, 255, 0.7), 0 0 0 6px rgba(124, 92, 255, 0.12);
  cursor: pointer;
  transition: transform 0.2s;
}
.pxst-launch:hover {
  transform: translateY(-3px) scale(1.04);
}
.pxst-launch__icon {
  font-size: 24px;
  line-height: 1;
}
.pxst-launch.is-open .pxst-launch__icon {
  transform: scale(0.9);
}
.pxst-launch.pxst-side-left {
  left: 16px;
}
.pxst-launch.pxst-side-right {
  right: 16px;
  bottom: calc(var(--bottom-bar-h, 0px) + 14px + 52px + 12px + env(safe-area-inset-bottom, 0px));
}

.pxst-teaser {
  position: fixed;
  z-index: 95;
  bottom: calc(var(--bottom-bar-h, 0px) + 76px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: flex-start;
  max-width: min(300px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--pxst-border2);
  border-radius: 16px;
  background: var(--pxst-card);
  box-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.pxst-teaser.is-in {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.pxst-teaser.pxst-side-left {
  left: 16px;
}
.pxst-teaser.pxst-side-right {
  right: 16px;
  bottom: calc(var(--bottom-bar-h, 0px) + 140px + env(safe-area-inset-bottom, 0px));
}
.pxst-teaser__text {
  flex: 1;
  padding: 12px 4px 12px 14px;
  border: 0;
  background: none;
  color: var(--pxst-text);
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}
.pxst-teaser__x,
.pxst-toast__x {
  flex: none;
  width: 32px;
  height: 32px;
  border: 0;
  background: none;
  color: var(--pxst-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.pxst-chat {
  position: fixed;
  z-index: 1000;
  inset: auto 0 0 0;
  display: flex;
  flex-direction: column;
  height: min(86vh, 640px);
  height: min(86dvh, 640px);
  background: var(--pxst-bg);
  border: 1px solid var(--pxst-border2);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, 0.85);
  overflow: hidden;
}
.pxst-chat[hidden] {
  display: none;
}
.pxst-chat__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  border-bottom: 1px solid var(--pxst-border);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.22), rgba(34, 211, 238, 0.12));
}
.pxst-chat__head > div {
  flex: 1;
}
.pxst-chat__avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--pxst-card);
  font-size: 22px;
}
.pxst-chat__name {
  margin: 0;
  font-weight: 800;
}
.pxst-chat__status {
  margin: 0;
  color: var(--pxst-muted);
  font-size: 0.8rem;
}
.pxst-chat__close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--pxst-text);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.pxst-chat__close:hover {
  background: rgba(255, 255, 255, 0.06);
}
.pxst-chat__log {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pxst-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.92rem;
  line-height: 1.5;
  word-wrap: break-word;
}
.pxst-msg--bot {
  align-self: flex-start;
  background: var(--pxst-card);
  border: 1px solid var(--pxst-border);
  border-bottom-left-radius: 6px;
}
.pxst-msg--user {
  align-self: flex-end;
  background: var(--pxst-accent);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.pxst-msg .pxst-result {
  margin: 10px 0 2px;
}
.pxst-msg .pxst-table {
  margin: 8px 0 4px;
}
.pxst-small {
  margin: 6px 0 0;
  color: var(--pxst-muted);
  font-size: 0.82rem;
}
.pxst-msg--typing {
  display: flex;
  gap: 4px;
  padding: 14px;
}
.pxst-msg--typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pxst-muted);
  animation: pxst-dot 1s infinite ease-in-out;
}
.pxst-msg--typing span:nth-child(2) {
  animation-delay: 0.15s;
}
.pxst-msg--typing span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes pxst-dot {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}
.pxst-chat__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 14px 10px;
  max-height: 40%;
  overflow-y: auto;
}
.pxst-chat__quick:empty {
  display: none;
}
.pxst-quick {
  padding: 8px 12px;
  border: 1px solid var(--pxst-border2);
  border-radius: 999px;
  background: var(--pxst-card);
  color: var(--pxst-text);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.pxst-quick:hover,
.pxst-quick:focus-visible {
  border-color: var(--pxst-accent);
  background: var(--pxst-accent-soft);
}
.pxst-chat__form {
  display: flex;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--pxst-border);
}
.pxst-chat__input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--pxst-border2);
  border-radius: 12px;
  background: var(--pxst-card);
  color: var(--pxst-text);
  font: inherit;
  font-size: 16px;
}
.pxst-chat__input:focus {
  outline: 2px solid var(--pxst-accent);
  outline-offset: 1px;
}
.pxst-chat__send {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--pxst-accent);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

@media (min-width: 768px) {
  .pxst-launch {
    width: 60px;
    height: 60px;
    bottom: 24px;
  }
  .pxst-launch.pxst-side-left {
    left: 24px;
  }
  .pxst-launch.pxst-side-right {
    right: 24px;
    bottom: 100px;
  }
  .pxst-teaser {
    bottom: 96px;
  }
  .pxst-teaser.pxst-side-left {
    left: 24px;
  }
  .pxst-teaser.pxst-side-right {
    right: 24px;
    bottom: 172px;
  }
  .pxst-chat {
    inset: auto auto 96px 24px;
    width: 390px;
    height: min(640px, calc(100vh - 140px));
    border-radius: 20px;
  }
  .pxst-chat.pxst-side-right {
    inset: auto 24px 172px auto;
    height: min(600px, calc(100vh - 200px));
  }
}

/* ---------- Toast (device tip, referral saved) ---------- */
.pxst-toast {
  position: fixed;
  z-index: 96;
  left: 16px;
  right: 16px;
  bottom: calc(var(--bottom-bar-h, 0px) + 80px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 6px 12px 14px;
  border: 1px solid var(--pxst-border2);
  border-radius: 16px;
  background: var(--pxst-card);
  box-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.85);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s;
}
.pxst-toast.is-in {
  opacity: 1;
  transform: none;
}
.pxst-toast__icon {
  font-size: 20px;
  line-height: 1.3;
}
.pxst-toast__text {
  flex: 1;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
}
.pxst-toast__link {
  color: var(--pxst-cyan) !important;
  font-weight: 600;
}
@media (min-width: 768px) {
  .pxst-toast {
    right: auto;
    left: 24px;
    bottom: 100px;
    max-width: 360px;
  }
  .pxst-toast.pxst-side-right {
    left: auto;
    right: 24px;
    bottom: 180px;
  }
}

/* ---------- Exit popup ---------- */
.pxst-overlay {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(5, 7, 13, 0.72);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.2s;
}
.pxst-overlay.is-in {
  opacity: 1;
}
.pxst-popup {
  --pxst-card: var(--card, #131a2a);
  position: relative;
  width: min(420px, 100%);
  padding: 32px 26px 18px;
  border: 1px solid var(--border-strong, rgba(255, 255, 255, 0.14));
  border-radius: 22px;
  background: radial-gradient(120% 80% at 50% 0%, rgba(37, 211, 102, 0.14), transparent 60%), var(--pxst-card);
  text-align: center;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.9);
  transform: translateY(10px) scale(0.98);
  transition: transform 0.25s;
}
.pxst-overlay.is-in .pxst-popup {
  transform: none;
}
.pxst-popup__x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--pxst-muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.pxst-popup__icon {
  margin: 0 0 6px;
  font-size: 40px;
  line-height: 1;
}
.pxst-popup__title {
  margin: 0 0 8px;
  font-family: var(--font-head, inherit);
  font-size: 1.5rem;
  font-weight: 800;
}
.pxst-popup__text {
  margin: 0 0 20px;
  color: var(--pxst-muted);
  font-size: 0.98rem;
  line-height: 1.55;
}
.pxst-popup__no {
  margin-top: 6px;
  color: var(--pxst-muted);
}

/* ---------- [plex_referral] ---------- */
.pxst-ref {
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid rgba(255, 176, 32, 0.4);
  border-radius: var(--radius-card, 20px);
  background: radial-gradient(120% 80% at 50% 0%, rgba(255, 176, 32, 0.12), transparent 60%), var(--pxst-card);
}
.pxst-ref .pxst-ref__badge {
  display: inline-block;
  margin: 0 0 10px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--pxst-gold);
  color: #0b0f1a !important;
  font-weight: 800;
  font-size: 0.85rem;
}
.pxst-ref__title {
  margin: 0 0 8px;
}
.pxst-ref__text {
  color: var(--pxst-muted);
}
.pxst-ref__steps {
  margin: 14px 0 20px;
  padding-left: 22px;
}
.pxst-ref__steps li + li {
  margin-top: 6px;
}
.pxst-ref__note {
  margin: 12px 0 0;
  color: var(--pxst-muted);
  font-size: 0.82rem;
}

/* Hide the chat button while the mobile menu is open, and on print. */
html:has(.site-nav.is-open) .pxst-launch,
html:has(.site-nav.is-open) .pxst-teaser {
  display: none;
}
@media print {
  .pxst-launch,
  .pxst-teaser,
  .pxst-chat,
  .pxst-toast,
  .pxst-overlay {
    display: none !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pxst-launch,
  .pxst-teaser,
  .pxst-toast,
  .pxst-overlay,
  .pxst-popup,
  .pxst-choice,
  .pxst-btn {
    transition: none;
  }
  .pxst-msg--typing span {
    animation: none;
  }
}
