#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: rgba(0, 0, 0, 0.45);
  animation: pm-auth-fade-in 0.2s ease-out;
}

.pm-auth-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  min-height: 220px;
  background: #fff;
  border-radius: 20px;
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(0, 0, 0, 0.04);
  padding: 36px 32px 32px;
  overflow: hidden;
}

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

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

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

.pm-auth-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid #e8f0fe;
  border-top-color: #1452f0;
  border-radius: 50%;
  animation: pm-auth-spin 0.85s linear infinite;
}

.pm-auth-loading-label {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #334155;
  letter-spacing: -0.01em;
}

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

.pm-auth-loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1452f0;
  animation: pm-auth-dot 1.2s ease-in-out infinite;
}

.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: 56px;
  height: 56px;
  margin-bottom: 20px;
  border-radius: 50%;
  background: #fef3c7;
  color: #d97706;
}

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

.pm-auth-title {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.pm-auth-body {
  margin: 0 0 28px;
  font-size: 15px;
  line-height: 1.6;
  color: #64748b;
  max-width: 340px;
}

.pm-auth-register {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 10px;
  background: #1452f0;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.pm-auth-register:hover {
  background: #1145d4;
}

.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: 20px;
  font-weight: 600;
  line-height: 1.3;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.pm-auth-check-tagline {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.55;
  color: #64748b;
}

.pm-auth-check-session {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 6px 14px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #eff6ff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #1452f0;
  font-variant-numeric: tabular-nums;
}

.pm-auth-check-session-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1452f0;
  box-shadow: 0 0 8px rgba(20, 82, 240, 0.35);
}

.pm-auth-check-card {
  margin: 0 0 20px;
  padding: 18px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
}

.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: #e2e8f0;
}

.pm-auth-check-step-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  flex-shrink: 0;
}

.pm-auth-check-step.is-done .pm-auth-check-step-icon {
  border-color: #bfdbfe;
  color: #1452f0;
  background: #eff6ff;
}

.pm-auth-check-step.is-active .pm-auth-check-step-icon {
  border-color: #93c5fd;
  background: #fff;
}

.pm-auth-check-step.is-error .pm-auth-check-step-icon {
  border-color: #fde68a;
  color: #b45309;
  background: #fffbeb;
}

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

.pm-auth-check-step-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #e8f0fe;
  border-top-color: #1452f0;
  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: #0f172a;
  line-height: 1.35;
}

.pm-auth-check-step-meta {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.pm-auth-check-step-badge {
  display: inline-block;
  margin-bottom: 6px;
  padding: 2px 8px;
  border-radius: 4px;
  background: #dbeafe;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #1452f0;
}

.pm-auth-check-notice {
  margin: 16px 0 0;
  padding: 14px 16px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #eff6ff;
  font-size: 13px;
  line-height: 1.55;
  color: #334155;
}

.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: 10px;
  background: #1452f0;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.pm-auth-check-continue:hover {
  background: #1145d4;
}

.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.3;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.pm-auth-bind-device-line {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #64748b;
  white-space: nowrap;
}

.pm-auth-bind-device-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 2px;
  padding: 3px 10px 3px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  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 minmax(0, max-content);
  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(20, 82, 240, 0.35);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #1452f0;
}

.pm-auth-bind-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: #64748b;
  white-space: nowrap;
}

.pm-auth-bind-text strong {
  font-weight: 600;
  color: #0f172a;
}

.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: #0f172a;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  box-shadow: 0 1px 0 #e2e8f0;
  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;
}

.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: 10px;
  background: #1452f0;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: default;
  opacity: 0.85;
}

.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;
  }
}

/* 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 #1452f0;
  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;
  }
}
