/* MPN Branded SlateSwitch — Expanded Capsule Pill + Neural-Grid Command Drawer */

.mpn-slateswitch-mount {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  z-index: 60;
}

.mpn-ss-pill-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 8px 0 4px;
  gap: 8px;
  border-radius: 9999px;
  border: 1px solid rgba(96, 165, 250, 0.42);
  background: linear-gradient(135deg, #060b22 0%, #0d1946 55%, #132366 100%);
  color: #ffffff;
  box-shadow:
    0 8px 24px -8px rgba(6, 11, 34, 0.78),
    0 0 16px -4px rgba(56, 189, 248, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 150ms ease;
  white-space: nowrap;
}

.mpn-ss-pill-wrap:hover,
.mpn-ss-pill-wrap.is-open {
  border-color: rgba(56, 189, 248, 0.85);
  box-shadow:
    0 12px 28px -8px rgba(6, 11, 34, 0.88),
    0 0 22px -2px rgba(56, 189, 248, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.14) inset;
}

.mpn-ss-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
  height: 100%;
  border-radius: 9999px;
}

.mpn-ss-trigger:focus-visible,
.mpn-ss-copy-btn:focus-visible,
.mpn-ss-close:focus-visible,
.mpn-ss-btn:focus-visible,
.mpn-ss-footer a:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

/* Neural Orb */
.mpn-ss-orb {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 9999px;
  background: radial-gradient(circle at 38% 35%, #1e3a8a 0%, #070d28 68%, #030718 100%);
  box-shadow:
    0 0 14px rgba(56, 189, 248, 0.55),
    0 0 0 1px rgba(147, 197, 253, 0.3) inset;
}

.mpn-ss-orb-svg {
  width: 32px;
  height: 32px;
  display: block;
}

.mpn-ss-orb-ring {
  transform-origin: center;
  animation: mpnSsOrbit 12s linear infinite;
}

@keyframes mpnSsOrbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 3 Glowing Mini Agent Nodes inside Pill */
.mpn-ss-nodes {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.mpn-ss-node {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 9999px;
  font-size: 10px;
  line-height: 1;
}

.mpn-ss-node--cyan {
  border: 1px solid rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.14);
  color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.28);
}

.mpn-ss-node--blue {
  border: 1px solid rgba(96, 165, 250, 0.55);
  background: rgba(36, 92, 242, 0.22);
  color: #93c5fd;
  box-shadow: 0 0 8px rgba(36, 92, 242, 0.32);
}

.mpn-ss-node--gold {
  border: 1px solid rgba(251, 191, 36, 0.55);
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.26);
}

.mpn-ss-label {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #f8fafc;
  line-height: 1;
}

.mpn-ss-label-short {
  display: none;
}

.mpn-ss-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(147, 197, 253, 0.22);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  color: #dbeafe;
  cursor: pointer;
  padding: 0;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.mpn-ss-copy-btn:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.6);
  color: #ffffff;
}

/* State 2 — Neural-Grid Command Drawer (mounted on document.body) */
.mpn-ss-drawer {
  position: fixed;
  z-index: 9999;
  width: min(404px, calc(100vw - 24px));
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  border-radius: 18px;
  border: 1px solid rgba(96, 165, 250, 0.34);
  background:
    radial-gradient(circle at 82% 8%, rgba(36, 92, 242, 0.28) 0%, transparent 48%),
    radial-gradient(circle at 18% 92%, rgba(56, 189, 248, 0.16) 0%, transparent 45%),
    linear-gradient(180deg, #060b22 0%, #091338 52%, #05091c 100%);
  color: #f8fafc;
  padding: 18px;
  box-shadow:
    0 32px 72px -16px rgba(3, 7, 24, 0.9),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.mpn-ss-drawer::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background-image:
    linear-gradient(rgba(96, 165, 250, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 165, 250, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.65) 0%, transparent 75%);
  pointer-events: none;
}

.mpn-ss-drawer > * {
  position: relative;
}

.mpn-ss-drawer.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mpn-ss-drawer__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(147, 197, 253, 0.16);
}

.mpn-ss-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #38bdf8;
}

.mpn-ss-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
}

.mpn-ss-title {
  margin: 5px 0 0;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: #ffffff;
}

.mpn-ss-subtitle {
  margin: 4px 0 0;
  font-size: 12px;
  color: rgba(219, 234, 254, 0.78);
}

.mpn-ss-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 9999px;
  border: 1px solid rgba(147, 197, 253, 0.24);
  background: rgba(255, 255, 255, 0.06);
  color: #dbeafe;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.mpn-ss-close:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.mpn-ss-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.mpn-ss-stat {
  border-radius: 10px;
  border: 1px solid rgba(147, 197, 253, 0.16);
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 10px;
}

.mpn-ss-stat__val {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
}

.mpn-ss-stat__lbl {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(191, 219, 254, 0.72);
}

.mpn-ss-card {
  margin-top: 12px;
  border-radius: 12px;
  border: 1px solid rgba(147, 197, 253, 0.18);
  background: rgba(6, 11, 34, 0.62);
  padding: 13px;
}

.mpn-ss-card--highlight {
  border-color: rgba(56, 189, 248, 0.45);
  background: linear-gradient(135deg, rgba(36, 92, 242, 0.24) 0%, rgba(56, 189, 248, 0.12) 100%);
}

.mpn-ss-card__title {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mpn-ss-badge {
  display: inline-block;
  border-radius: 9999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.mpn-ss-badge--gold {
  background: rgba(251, 191, 36, 0.16);
  color: #fcd34d;
  border-color: rgba(251, 191, 36, 0.42);
}

.mpn-ss-copy {
  margin: 6px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: rgba(219, 234, 254, 0.88);
}

.mpn-ss-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.mpn-ss-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  transition: transform 120ms ease, background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.mpn-ss-btn:active {
  transform: scale(0.98);
}

.mpn-ss-btn--primary {
  background: linear-gradient(135deg, #245cf2 0%, #1b1d8f 100%);
  border-color: rgba(96, 165, 250, 0.45);
  color: #ffffff;
  flex: 1 1 auto;
  box-shadow: 0 6px 18px -6px rgba(36, 92, 242, 0.65);
}

.mpn-ss-btn--primary:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #245cf2 100%);
}

.mpn-ss-btn--gold {
  background: linear-gradient(135deg, #fbbf24 0%, #d4af37 100%);
  color: #060b22;
  flex: 1 1 auto;
}

.mpn-ss-btn--gold:hover {
  background: linear-gradient(135deg, #fde047 0%, #eab308 100%);
}

.mpn-ss-btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(147, 197, 253, 0.24);
  color: #f8fafc;
}

.mpn-ss-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.14);
}

.mpn-ss-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.mpn-ss-form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.mpn-ss-input {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(147, 197, 253, 0.24);
  background: rgba(3, 7, 24, 0.72);
  color: #ffffff;
  font: inherit;
  font-size: 12.5px;
  padding: 8px 10px;
}

.mpn-ss-input::placeholder {
  color: rgba(191, 219, 254, 0.55);
}

.mpn-ss-output {
  margin-top: 10px;
  border-radius: 8px;
  border: 1px solid rgba(147, 197, 253, 0.22);
  background: rgba(3, 7, 24, 0.88);
  padding: 10px;
  font-size: 11.5px;
  line-height: 1.45;
  color: #dbeafe;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 130px;
  overflow-y: auto;
}

.mpn-ss-plans {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.mpn-ss-plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-radius: 8px;
  border: 1px solid rgba(147, 197, 253, 0.16);
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 10px;
  text-decoration: none;
  color: inherit;
}

.mpn-ss-plan-row:hover {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(255, 255, 255, 0.08);
}

.mpn-ss-plan-row strong {
  display: block;
  font-size: 12px;
  color: #ffffff;
}

.mpn-ss-plan-row span {
  display: block;
  font-size: 11px;
  color: rgba(219, 234, 254, 0.75);
}

.mpn-ss-plan-price {
  font-size: 12px;
  font-weight: 800;
  color: #7dd3fc;
  white-space: nowrap;
}

.mpn-ss-status-msg {
  margin-top: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #34d399;
}

.mpn-ss-status-msg.is-error {
  color: #fca5a5;
}

.mpn-ss-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(147, 197, 253, 0.14);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 10.5px;
  color: rgba(191, 219, 254, 0.75);
}

.mpn-ss-footer-proto {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.mpn-ss-footer a {
  color: #7dd3fc;
  font-weight: 700;
  text-decoration: none;
}

.mpn-ss-footer a:hover {
  color: #ffffff;
  text-decoration: underline;
}

@media (max-width: 1280px) {
  .mpn-ss-nodes {
    display: none;
  }

  .mpn-ss-label-full {
    display: none;
  }

  .mpn-ss-label-short {
    display: inline;
  }
}

@media (max-width: 1120px) {
  .mpn-slateswitch-mount {
    margin-left: auto;
  }

  .mpn-ss-pill-wrap {
    height: 38px;
    padding: 0 8px 0 4px;
    gap: 6px;
  }

  .mpn-ss-copy-btn {
    display: none;
  }
}

@media (max-width: 480px) {
  .mpn-ss-orb {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }

  .mpn-ss-orb-svg {
    width: 28px;
    height: 28px;
  }

  .mpn-ss-label {
    font-size: 11px;
  }

  .mpn-ss-drawer {
    padding: 15px;
  }
}
