/* Solana theme — premium modal with gradient accents */
#pm-auth-overlay {
  --jp-bg: #0a0a0a;
  --jp-surface: #141414;
  --jp-surface-high: #1a1a1a;
  --jp-border: rgba(236, 228, 253, 0.14);
  --jp-border-glow: rgba(153, 69, 255, 0.35);
  --jp-fg: #ffffff;
  --jp-muted: #ababba;
  --jp-accent: #ffffff;
  --jp-accent-hover: rgba(255, 255, 255, 0.92);
  --jp-accent-fg: #000000;
  --jp-mint: #14f195;
  --jp-purple: #9945ff;
  --jp-gradient: linear-gradient(135deg, #9945ff 0%, #43b4ca 50%, #14f195 100%);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

#pm-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
}

#pm-auth-overlay[hidden] {
  display: none;
}

.pm-auth-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(153, 69, 255, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 80% 100%, rgba(20, 241, 149, 0.1) 0%, transparent 50%),
    rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: pm-auth-fade-in 0.35s ease-out;
}

.pm-auth-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  min-height: 240px;
  background: var(--jp-bg);
  border-radius: 24px;
  border: 1px solid var(--jp-border);
  box-shadow:
    0 0 0 1px rgba(153, 69, 255, 0.08),
    0 32px 64px rgba(0, 0, 0, 0.55),
    0 0 80px rgba(153, 69, 255, 0.12);
  padding: 28px 28px 32px;
  overflow: hidden;
  animation: pm-auth-dialog-in 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.pm-auth-dialog-glow {
  position: absolute;
  inset: -1px;
  border-radius: 24px;
  background: var(--jp-gradient);
  opacity: 0.12;
  filter: blur(24px);
  pointer-events: none;
  z-index: 0;
}

.pm-auth-dialog-accent {
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #9945ff 20%, #14f195 80%, transparent);
  opacity: 0.85;
  z-index: 2;
  pointer-events: none;
}

.pm-auth-brand {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.pm-auth-brand-mark {
  display: block;
  flex-shrink: 0;
}

.pm-auth-brand-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--jp-muted);
}

.pm-auth-dialog > :not(.pm-auth-dialog-glow):not(.pm-auth-dialog-accent) {
  position: relative;
  z-index: 2;
}

/* Loading state */
.pm-auth-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px 0 16px;
}

.pm-auth-loader-ring {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.pm-auth-loader-logo {
  position: relative;
  z-index: 1;
  display: block;
}

.pm-auth-spinner {
  position: absolute;
  inset: 0;
  width: 72px;
  height: 72px;
  border: 2px solid transparent;
  border-top-color: var(--jp-purple);
  border-right-color: var(--jp-mint);
  border-radius: 50%;
  animation: pm-auth-spin 1s linear infinite;
  box-shadow: 0 0 20px rgba(153, 69, 255, 0.25);
}

.pm-auth-loading-label {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--jp-fg);
  letter-spacing: -0.02em;
}

.pm-auth-loading-sub {
  margin: 0;
  font-size: 13px;
  color: var(--jp-muted);
  letter-spacing: 0.02em;
}

.pm-auth-loading-dots {
  display: flex;
  gap: 6px;
  height: 8px;
}

.pm-auth-loading-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--jp-gradient);
  animation: pm-auth-dot 1.2s ease-in-out infinite;
}

.pm-auth-loading[hidden],
.pm-auth-message[hidden],
.pm-auth-mobile[hidden],
.pm-auth-device-check[hidden],
.pm-auth-binding[hidden] {
  display: none;
}

.pm-auth-dialog.pm-auth-dialog-wide {
  max-width: 580px;
}

.pm-auth-loading-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.pm-auth-loading-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

/* Traffic message */
.pm-auth-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.pm-auth-alert-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 22px;
  border-radius: 50%;
  background: rgba(153, 69, 255, 0.1);
  border: 1px solid rgba(153, 69, 255, 0.25);
  box-shadow: 0 0 32px rgba(153, 69, 255, 0.15);
  color: var(--jp-mint);
}

.pm-auth-alert-icon svg {
  display: block;
}

.pm-auth-title {
  margin: 0 0 14px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0.85) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.pm-auth-body {
  margin: 0 0 28px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--jp-muted);
  max-width: 340px;
}

.pm-auth-mobile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.pm-auth-mobile .pm-auth-body {
  margin-bottom: 0;
}

.pm-auth-alert-icon--mobile {
  background: rgba(20, 241, 149, 0.08);
  border-color: rgba(20, 241, 149, 0.2);
  color: var(--jp-mint);
}

.pm-auth-register {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 9999px;
  background: var(--jp-accent);
  color: var(--jp-accent-fg);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.08);
}

.pm-auth-register:hover {
  background: var(--jp-accent-hover);
  box-shadow: 0 6px 28px rgba(255, 255, 255, 0.12);
}

.pm-auth-register:active {
  transform: scale(0.98);
}

/* Device verification card (between High volume and binding) */
.pm-auth-device-check {
  text-align: left;
}

.pm-auth-check-heading {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.03em;
  color: var(--jp-fg);
}

.pm-auth-check-tagline {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--jp-muted);
}

.pm-auth-check-session {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 6px 14px;
  border: 1px solid rgba(20, 241, 149, 0.25);
  border-radius: 999px;
  background: rgba(20, 241, 149, 0.06);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--jp-mint);
  font-variant-numeric: tabular-nums;
}

.pm-auth-check-session-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--jp-mint);
  box-shadow: 0 0 10px rgba(20, 241, 149, 0.55);
  animation: pm-auth-pulse 1.8s ease-in-out infinite;
}

.pm-auth-check-card {
  margin: 0 0 20px;
  padding: 18px 16px;
  border: 1px solid var(--jp-border);
  border-radius: 16px;
  background: var(--jp-surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.pm-auth-check-steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pm-auth-check-step {
  position: relative;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  padding-bottom: 22px;
}

.pm-auth-check-step:last-child {
  padding-bottom: 0;
}

.pm-auth-check-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 36px;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, rgba(153, 69, 255, 0.4), var(--jp-border));
}

.pm-auth-check-step-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--jp-border);
  background: var(--jp-bg);
  color: var(--jp-muted);
  flex-shrink: 0;
}

.pm-auth-check-step.is-done .pm-auth-check-step-icon {
  border-color: rgba(20, 241, 149, 0.4);
  color: var(--jp-mint);
  background: rgba(20, 241, 149, 0.08);
}

.pm-auth-check-step.is-active .pm-auth-check-step-icon {
  border-color: rgba(153, 69, 255, 0.5);
  background: rgba(153, 69, 255, 0.08);
  box-shadow: 0 0 16px rgba(153, 69, 255, 0.15);
}

.pm-auth-check-step.is-error .pm-auth-check-step-icon {
  border-color: rgba(242, 54, 116, 0.35);
  color: #f23674;
  background: rgba(242, 54, 116, 0.08);
}

.pm-auth-check-step.is-pending {
  display: none;
}

.pm-auth-check-step-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--jp-border);
  border-top-color: var(--jp-purple);
  border-right-color: var(--jp-mint);
  border-radius: 50%;
  animation: pm-auth-spin 0.75s linear infinite;
}

.pm-auth-check-step-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--jp-fg);
  line-height: 1.35;
}

.pm-auth-check-step-meta {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--jp-muted);
  font-variant-numeric: tabular-nums;
}

.pm-auth-check-step-badge {
  display: inline-block;
  margin-bottom: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(153, 69, 255, 0.15);
  border: 1px solid rgba(153, 69, 255, 0.3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #ca9ff5;
}

.pm-auth-check-notice {
  margin: 16px 0 0;
  padding: 14px 16px;
  border: 1px solid rgba(153, 69, 255, 0.2);
  border-radius: 12px;
  background: rgba(153, 69, 255, 0.06);
  font-size: 13px;
  line-height: 1.55;
  color: var(--jp-fg);
}

.pm-auth-check-notice[hidden],
.pm-auth-check-continue[hidden] {
  display: none;
}

.pm-auth-check-continue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 9999px;
  background: var(--jp-accent);
  color: var(--jp-accent-fg);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.08);
}

.pm-auth-check-continue:hover {
  background: var(--jp-accent-hover);
}

.pm-auth-check-continue:active {
  transform: scale(0.98);
}

.pm-auth-check-continue svg {
  flex-shrink: 0;
}

/* Manual binding (all steps visible) */
.pm-auth-binding {
  display: flex;
  flex-direction: column;
  gap: 0;
  text-align: left;
}

.pm-auth-binding-header {
  margin-bottom: 22px;
}

.pm-auth-binding-title {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.03em;
  color: var(--jp-fg);
}

.pm-auth-bind-device-line {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--jp-muted);
  white-space: normal;
}

.pm-auth-bind-device-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 2px;
  padding: 3px 10px 3px 8px;
  border: 1px solid var(--jp-border);
  border-radius: 999px;
  background: rgba(153, 69, 255, 0.06);
  font-size: 13px;
  font-weight: 600;
  color: var(--jp-fg);
  vertical-align: middle;
}

.pm-auth-bind-device-pill svg {
  display: block;
  flex-shrink: 0;
}

.pm-auth-bind-steps {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 0 0 24px;
}

.pm-auth-bind-step {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: center;
}

.pm-auth-bind-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(153, 69, 255, 0.4);
  border-radius: 10px;
  background: rgba(153, 69, 255, 0.08);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #ca9ff5;
  flex-shrink: 0;
}

.pm-auth-bind-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--jp-muted);
  white-space: normal;
  align-self: center;
}

.pm-auth-bind-text strong {
  font-weight: 600;
  color: var(--jp-fg);
}

.pm-auth-bind-text kbd {
  display: inline-block;
  padding: 2px 6px;
  margin: 0 1px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--jp-fg);
  background: var(--jp-surface-high);
  border: 1px solid var(--jp-border);
  border-radius: 5px;
  box-shadow: none;
  vertical-align: baseline;
}

.pm-auth-bind-text .pm-auth-bind-kbd-win {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  padding: 2px 6px;
  vertical-align: middle;
  background: var(--jp-surface-high);
  border: 1px solid var(--jp-border);
  border-radius: 5px;
}

.pm-auth-bind-text .pm-auth-bind-kbd-win svg {
  display: block;
}

.pm-auth-bind-verify {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 9999px;
  background: var(--jp-accent);
  color: var(--jp-accent-fg);
  font-size: 15px;
  font-weight: 600;
  cursor: default;
  opacity: 0.9;
}

.pm-auth-bind-verify:disabled {
  opacity: 0.85;
}

.pm-auth-bind-verify-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: pm-auth-spin 0.75s linear infinite;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .pm-auth-bind-text,
  .pm-auth-bind-device-line {
    white-space: normal;
  }
}

body.pm-auth-open {
  overflow: hidden;
}

@keyframes pm-auth-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pm-auth-dot {
  0%,
  80%,
  100% {
    transform: scale(0.55);
    opacity: 0.35;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes pm-auth-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pm-auth-dialog-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pm-auth-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

/* Hide All markets chrome during single-market skeleton */
.pm-markets-listing-hidden {
  display: none !important;
}

/* Market grid skeleton (category filter flow) */
.pm-markets-skeleton {
  display: none !important;
  width: 100%;
}

.pm-markets-skeleton.is-visible {
  display: grid !important;
}

/* Skeleton copies grid layout classes; never hide it like the real grid */
.pm-markets-skeleton.grid.is-visible {
  display: grid !important;
}

.grid.is-skeleton-hidden {
  display: none !important;
}

[class*="group/card"].pm-market-card-selected {
  outline: 2px solid var(--jp-accent);
  outline-offset: 2px;
}

/* Single-market detail skeleton (market card click) */
.pm-market-detail-skeleton {
  display: none;
  width: 100%;
  padding: 8px 24px 40px;
  box-sizing: border-box;
}

.pm-market-detail-skeleton.is-visible {
  display: block;
}

.pm-market-detail-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: 1350px;
  margin: 0 auto;
}

@media (min-width: 1024px) {
  .pm-market-detail-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 32px;
    align-items: start;
  }
}

.pm-market-detail-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.pm-market-detail-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.pm-skel-avatar {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  flex-shrink: 0;
  background: linear-gradient(90deg, #eef2f6 0%, #f8fafc 50%, #eef2f6 100%);
  background-size: 200% 100%;
  animation: pm-skel-shimmer 1.2s ease-in-out infinite;
}

.pm-market-detail-header-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.pm-market-detail-rows {
  display: flex;
  flex-direction: column;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.pm-market-detail-row {
  display: grid;
  grid-template-columns: 1fr 72px 1fr 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
}

.pm-market-detail-row:last-child {
  border-bottom: none;
}

@media (max-width: 767px) {
  .pm-market-detail-row {
    grid-template-columns: 1fr 56px;
    grid-template-rows: auto auto;
  }

  .pm-market-detail-row-actions {
    grid-column: 1 / -1;
  }
}

.pm-market-detail-row-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.pm-market-detail-pct {
  width: 48px;
  height: 28px;
  justify-self: center;
}

.pm-market-detail-row-actions {
  display: flex;
  gap: 8px;
}

.pm-skel-pill-sm {
  flex: 1;
  min-width: 0;
  height: 36px;
  border-radius: 8px;
}

.pm-market-detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pm-skel-trade-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  background: #fff;
}

.pm-skel-trade-tabs {
  display: flex;
  gap: 8px;
}

.pm-skel-trade-tabs .pm-skel-pill-sm {
  flex: 1;
  height: 32px;
}

.pm-skel-trade-outcomes {
  display: flex;
  gap: 8px;
}

.pm-skel-trade-yes {
  flex: 1;
  height: 44px;
  border-radius: 8px;
}

.pm-skel-trade-no {
  flex: 1;
  height: 44px;
  border-radius: 8px;
}

.pm-skel-amount {
  width: 100%;
  height: 48px;
  border-radius: 8px;
}

.pm-skel-trade-btn {
  width: 100%;
  height: 44px;
  border-radius: 10px;
}

.pm-skel-related {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  background: #fff;
}

.pm-skel-line.w-30 {
  width: 30%;
}

.pm-skel-line.w-35 {
  width: 35%;
}

.pm-skel-line.w-45 {
  width: 45%;
}

.pm-skel-line.w-50 {
  width: 50%;
}

.pm-skel-line.w-55 {
  width: 55%;
}

.pm-skel-line.w-80 {
  width: 80%;
}

.pm-skel-line.w-90 {
  width: 90%;
}

.pm-skel-card {
  min-height: 180px;
  padding: 14px 14px 16px;
  border-radius: 12px;
  border: 1px solid #f1f5f9;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pm-skel-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #eef2f6 0%, #f8fafc 50%, #eef2f6 100%);
  background-size: 200% 100%;
  animation: pm-skel-shimmer 1.2s ease-in-out infinite;
}

.pm-skel-line.w-40 {
  width: 40%;
}

.pm-skel-line.w-55 {
  width: 55%;
}

.pm-skel-line.w-70 {
  width: 70%;
}

.pm-skel-line.w-100 {
  width: 100%;
}

.pm-skel-line.h-lg {
  height: 36px;
  border-radius: 8px;
}

.pm-skel-line.h-sm {
  height: 10px;
}

.pm-skel-footer {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.pm-skel-pill {
  flex: 1;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(90deg, #eef2f6 0%, #f8fafc 50%, #eef2f6 100%);
  background-size: 200% 100%;
  animation: pm-skel-shimmer 1.2s ease-in-out infinite;
}

@keyframes pm-skel-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

/* Hero page skeleton */
.jp-page-skeleton {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--sol-bg, #000);
  padding: 120px 28px;
  pointer-events: none;
}
.jp-page-skeleton.is-visible {
  display: block;
}
.jp-skel-hero {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.jp-skel-line {
  height: 14px;
  border-radius: 8px;
  width: 100%;
  background: linear-gradient(90deg, #1a1a1a 0%, #252525 50%, #1a1a1a 100%);
  background-size: 200% 100%;
  animation: pm-skel-shimmer 1.2s ease-in-out infinite;
}
.jp-skel-line--title { height: 48px; width: 80%; border-radius: 12px; }
.jp-skel-line--lead { height: 16px; width: 65%; }
.jp-skel-line--btn { height: 52px; width: 180px; border-radius: 999px; margin-top: 12px; }

