/* ═══════════════════════════════════════════════════════════════════════════
   XLS-68 Sponsor Sandbox: design system
   Clean educational UI for Sponsored Fees & Reserves (XRPL Devnet)
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --bg-0: #061211;
  --bg-1: #0a1c1b;
  --bg-2: #0f2826;
  --bg-3: #143532;
  --surface: rgba(12, 32, 30, 0.85);
  --surface-solid: #0c201e;
  --border: rgba(45, 212, 191, 0.14);
  --border-strong: rgba(45, 212, 191, 0.32);
  --text: #e8f5f3;
  --text-muted: #8aa8a4;
  --text-dim: #5f7a76;
  --accent: #2dd4bf;
  --accent-dim: #14b8a6;
  --accent-glow: rgba(45, 212, 191, 0.18);
  --amber: #fbbf24;
  --amber-dim: #d97706;
  --amber-bg: rgba(251, 191, 36, 0.1);
  --green: #4ade80;
  --green-bg: rgba(74, 222, 128, 0.12);
  --red: #f87171;
  --red-bg: rgba(248, 113, 113, 0.12);
  --sky: #7dd3fc;
  --sky-bg: rgba(125, 211, 252, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Consolas, monospace;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --max: 1180px;
  --header-h: 64px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.sponsor-app {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg-0);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(45, 212, 191, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(20, 184, 166, 0.06), transparent),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
  overflow-x: hidden;
}

/* Base links: never browser blue / purple (unreadable on dark teal backdrop) */
body.sponsor-app a,
body.sponsor-app a:link,
body.sponsor-app a:visited {
  color: var(--accent);
}

body.sponsor-app a:hover,
body.sponsor-app a:focus-visible {
  color: #5eead4;
}

body.sponsor-app a:active {
  color: #99f6e4;
}

/* Inline content links (guide, muted notes, FAQ body) */
body.sponsor-app .sp-muted a,
body.sponsor-app .sp-muted a:link,
body.sponsor-app .sp-muted a:visited,
body.sponsor-app .sp-fold__body a:not(.sp-btn):not(.sp-doc-link),
body.sponsor-app .sp-card p a,
body.sponsor-app .sp-path a,
body.sponsor-app .sp-faq__a a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(45, 212, 191, 0.5);
  text-underline-offset: 0.15em;
}

body.sponsor-app .sp-muted a:hover,
body.sponsor-app .sp-fold__body a:not(.sp-btn):not(.sp-doc-link):hover,
body.sponsor-app .sp-card p a:hover,
body.sponsor-app .sp-path a:hover,
body.sponsor-app .sp-faq__a a:hover {
  color: #5eead4;
  text-decoration-color: #5eead4;
}

/* Chrome that should not look like body links */
body.sponsor-app .sp-brand,
body.sponsor-app .sp-brand:link,
body.sponsor-app .sp-brand:visited {
  color: var(--text);
  text-decoration: none;
}

body.sponsor-app .sp-nav a,
body.sponsor-app .sp-nav a:link,
body.sponsor-app .sp-nav a:visited {
  color: var(--text-muted);
  text-decoration: none;
}

body.sponsor-app .sp-nav a:hover,
body.sponsor-app .sp-nav a.is-active {
  color: var(--accent);
}

body.sponsor-app .sp-doc-link,
body.sponsor-app .sp-doc-link:link,
body.sponsor-app .sp-doc-link:visited {
  color: inherit;
  text-decoration: none;
}

.canvas-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.25;
  pointer-events: none;
}

/* ── Header (mobile-friendly: matches production) ─────────────────────── */

.sp-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: rgba(6, 18, 17, 0.82);
  backdrop-filter: blur(14px);
}

.sp-header__inner {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.sp-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
  order: 1;
}

.sp-brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.sp-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-wrap: wrap;
  order: 2;
}

.sp-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}

.sp-nav a:hover {
  color: var(--accent);
  background: var(--accent-glow);
}

.sp-nav a.is-active {
  color: var(--accent);
  font-weight: 600;
}

.sp-header-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  order: 3;
}

.sp-nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
  order: 4;
}

.sp-nav-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sp-nav-toggle__bar {
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.15s ease;
}

.sp-nav-toggle[aria-expanded="true"] .sp-nav-toggle__bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.sp-nav-toggle[aria-expanded="true"] .sp-nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.sp-nav-toggle[aria-expanded="true"] .sp-nav-toggle__bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 720px) {
  .sp-header__inner {
    flex-wrap: wrap;
    row-gap: 0;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
  }

  .sp-nav-toggle {
    display: flex;
  }

  .sp-header-status {
    font-size: 0.7rem;
    margin-left: auto;
  }

  .sp-nav {
    order: 5;
    flex-basis: 100%;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.25s ease;
  }

  .sp-nav.is-open {
    visibility: visible;
    max-height: 70vh;
    overflow-y: auto;
    margin-top: var(--space-3);
    padding: var(--space-3) 0 var(--space-2);
    border-top: 1px solid var(--border);
  }

  .sp-nav a {
    padding: 0.75rem 0.6rem;
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .sp-header-status #connLabel {
    display: none;
  }
}

.sp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}

.sp-dot.live {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2);
}

.sp-dot.warn {
  background: var(--amber);
}

.sp-dot.err {
  background: var(--red);
}

/* ── Layout ─────────────────────────────────────────────────────────────── */

.sp-main {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--space-8) var(--space-5) var(--space-10);
}

@media (max-width: 640px) {
  .sp-main {
    padding: var(--space-5) var(--space-3) var(--space-8);
  }

  .sp-btn {
    white-space: normal;
    text-align: center;
  }

  .sp-btn-row > .sp-btn,
  .sp-btn-row > [style*="flex:1"] {
    min-width: 0;
  }
}

.sp-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: var(--space-6) var(--space-5);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.sp-footer a {
  color: var(--accent);
  text-decoration: none;
}

.sp-footer a:hover {
  text-decoration: underline;
}

/* ── Hero ───────────────────────────────────────────────────────────────── */

.sp-hero {
  text-align: center;
  margin-bottom: var(--space-8);
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
}

.sp-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  margin-bottom: var(--space-4);
}

.sp-hero h1 {
  margin: 0 0 var(--space-3);
  font-size: clamp(1.65rem, 4vw, 2.15rem);
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

.sp-hero__lead {
  margin: 0 0 var(--space-5);
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.65;
}

.sp-hero__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.sp-hero__meta a {
  color: var(--accent);
  text-decoration: none;
}

.sp-hero__meta a:hover {
  text-decoration: underline;
}

.sp-meta-sep {
  opacity: 0.45;
}

.sp-hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: var(--space-5);
}

.sp-hero__actions .sp-btn {
  text-decoration: none;
}

/* ── Stepper ────────────────────────────────────────────────────────────── */

.sp-stepper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-8);
  list-style: none;
  padding: 0;
  margin-left: 0;
  margin-right: 0;
}

.sp-step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  text-align: left;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.sp-step.is-done {
  border-color: rgba(74, 222, 128, 0.35);
}

.sp-step.is-current {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 1px var(--accent-glow), var(--shadow);
}

.sp-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--bg-3);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.sp-step.is-done .sp-step__num {
  background: var(--green-bg);
  color: var(--green);
}

.sp-step.is-current .sp-step__num {
  background: var(--accent-glow);
  color: var(--accent);
}

.sp-step__title {
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--text);
  margin: 0 0 0.2rem;
}

.sp-step__desc {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.4;
}

@media (max-width: 720px) {
  .sp-stepper {
    grid-template-columns: 1fr;
  }
}

/* ── Grid sections ──────────────────────────────────────────────────────── */

.sp-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
  align-items: start;
}

@media (max-width: 900px) {
  .sp-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ── Cards ──────────────────────────────────────────────────────────────── */

.sp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-5);
  box-shadow: var(--shadow);
}

.sp-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.sp-card__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.sp-card__subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

.sp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, opacity 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.sp-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sp-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.sp-btn:not(:disabled):active {
  transform: scale(0.98);
}

.sp-btn--primary {
  background: linear-gradient(180deg, #2dd4bf 0%, #14b8a6 100%);
  color: #042f2e;
  border-color: transparent;
}

.sp-btn--primary:not(:disabled):hover {
  filter: brightness(1.06);
}

.sp-btn--secondary {
  background: var(--bg-3);
  color: var(--text);
  border-color: var(--border-strong);
}

.sp-btn--secondary:not(:disabled):hover {
  background: #1a4440;
  border-color: var(--accent);
}

.sp-btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.sp-btn--ghost:not(:disabled):hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
}

.sp-btn--amber {
  background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
  color: #1c1000;
}

.sp-btn--amber:not(:disabled):hover {
  filter: brightness(1.05);
}

.sp-btn--block {
  width: 100%;
}

.sp-btn--pulse {
  animation: sp-btn-pulse 0.9s ease-in-out 2;
}

@keyframes sp-btn-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
  50% {
    box-shadow: 0 0 0 4px var(--accent-glow);
  }
}

.sp-btn--sm {
  padding: 0.4rem 0.7rem;
  font-size: 0.8rem;
}

.sp-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.sp-btn-row--stack {
  flex-direction: column;
}

/* Setup: three equal actions on one row (desktop) */
.sp-setup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.sp-setup-actions .sp-btn {
  flex: 1 1 0;
  min-width: 9.5rem;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .sp-setup-actions .sp-btn {
    flex: 1 1 100%;
    min-width: 0;
    white-space: normal;
  }
}

/* ── Forms ──────────────────────────────────────────────────────────────── */

.sp-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  letter-spacing: 0.02em;
}

.sp-input,
.sp-select {
  width: 100%;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  transition: border-color 0.15s;
}

.sp-input:focus,
.sp-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.sp-field {
  margin-bottom: var(--space-3);
}

.sp-field-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

@media (max-width: 640px) {
  .sp-field-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Badges / chips ─────────────────────────────────────────────────────── */

.sp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.sp-badge--sponsor {
  background: var(--amber-bg);
  color: var(--amber);
  border-color: rgba(251, 191, 36, 0.35);
}

.sp-badge--sponsee {
  background: var(--accent-glow);
  color: var(--accent);
  border-color: var(--border-strong);
}

.sp-badge--control {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.3);
}

.sp-badge--ok {
  background: var(--green-bg);
  color: var(--green);
  border-color: rgba(74, 222, 128, 0.35);
}

.sp-badge--off {
  background: var(--red-bg);
  color: var(--red);
  border-color: rgba(248, 113, 113, 0.35);
}

.sp-badge--live {
  background: var(--sky-bg);
  color: var(--sky);
  border-color: rgba(125, 211, 252, 0.3);
}

/* ── Account list (responsive grid: production) ────────────────────────── */

.sp-accounts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

@media (max-width: 980px) {
  .sp-accounts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .sp-accounts {
    grid-template-columns: 1fr;
  }
}

.sp-account {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
}

.sp-account--sponsor {
  border-color: rgba(251, 191, 36, 0.3);
}

.sp-account--sponsee {
  border-color: rgba(45, 212, 191, 0.3);
}

.sp-account__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.sp-account__addr {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text);
  word-break: break-all;
  line-height: 1.4;
}

.sp-account__addr a {
  color: inherit;
  text-decoration: none;
}

.sp-account__addr a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.sp-account__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-2);
}

.sp-account__meta strong {
  color: var(--accent);
  font-weight: 600;
  font-family: var(--mono);
}

.sp-account__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: var(--space-2);
}

.sp-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-6) var(--space-4);
  color: var(--text-dim);
  font-size: 0.875rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.15);
}

/* ── Setup + roles layout (stacked full-width) ──────────────────────────── */

.sp-setup-card {
  margin-bottom: var(--space-5);
}

.sp-roles-card {
  margin-bottom: var(--space-5);
}

.sp-wallets-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.sp-wallets-lead {
  margin: 0;
}

.sp-roles-actions {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  flex-wrap: wrap;
  gap: 0.5rem;
}



/* ── Role tiles ─────────────────────────────────────────────────────────── */

.sp-role-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

@media (max-width: 900px) {
  .sp-role-tiles {
    grid-template-columns: 1fr;
  }
}

.sp-role-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 100%;
  padding: var(--space-4);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.03), transparent 42%),
    var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.sp-role-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border-strong);
}

.sp-role-tile:hover {
  border-color: var(--border-strong);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.sp-role-tile--sponsor {
  border-color: rgba(251, 191, 36, 0.28);
  background:
    linear-gradient(165deg, rgba(251, 191, 36, 0.08), transparent 48%),
    var(--bg-0);
}

.sp-role-tile--sponsor::before {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.sp-role-tile--sponsee {
  border-color: rgba(45, 212, 191, 0.28);
  background:
    linear-gradient(165deg, rgba(45, 212, 191, 0.09), transparent 48%),
    var(--bg-0);
}

.sp-role-tile--sponsee::before {
  background: linear-gradient(90deg, #2dd4bf, #14b8a6);
}

.sp-role-tile--control {
  border-color: rgba(148, 163, 184, 0.28);
  background:
    linear-gradient(165deg, rgba(148, 163, 184, 0.08), transparent 48%),
    var(--bg-0);
}

.sp-role-tile--control::before {
  background: linear-gradient(90deg, #94a3b8, #64748b);
}

.sp-role-tile__head {
  margin-bottom: 0.35rem;
}

.sp-role-tile__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.sp-role-tile__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
  margin-top: -0.1rem;
}

.sp-role-tile__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease, transform 0.1s ease;
}

.sp-role-tile__icon-btn:hover:not(:disabled):not(.is-disabled) {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(45, 212, 191, 0.12);
}

.sp-role-tile__icon-btn:active:not(:disabled):not(.is-disabled) {
  transform: scale(0.96);
}

.sp-role-tile__icon-btn:disabled,
.sp-role-tile__icon-btn.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.sp-role-tile__icon-btn.is-copied {
  color: var(--green);
  border-color: rgba(74, 222, 128, 0.45);
  background: var(--green-bg);
}

.sp-role-tile--sponsor .sp-role-tile__icon-btn:hover:not(:disabled):not(.is-disabled) {
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.1);
}

.sp-role-tile--sponsee .sp-role-tile__icon-btn:hover:not(:disabled):not(.is-disabled) {
  color: #99f6e4;
  border-color: rgba(45, 212, 191, 0.4);
  background: var(--accent-glow);
}

.sp-role-tile--control .sp-role-tile__icon-btn:hover:not(:disabled):not(.is-disabled) {
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(148, 163, 184, 0.1);
}

.sp-role-tile__blurb {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.sp-role-tile .sp-label {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}

/* Fixed wallet address (no picker) */
.sp-role-tile__wallet {
  min-height: 2.55rem;
  display: flex;
  align-items: center;
  padding: 0.55rem 0.7rem;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.4;
  word-break: break-all;
}

.sp-role-tile__addr {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.sp-role-tile__addr:hover {
  color: var(--accent);
  text-decoration: underline;
}

.sp-role-tile--sponsor .sp-role-tile__addr:hover {
  color: #fde68a;
}

.sp-role-tile--sponsee .sp-role-tile__addr:hover {
  color: #99f6e4;
}

.sp-role-tile--control .sp-role-tile__addr:hover {
  color: #cbd5e1;
}

.sp-role-tile__placeholder {
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-dim);
  font-style: italic;
}

.sp-role-tile__select {
  font-family: var(--mono);
  font-size: 0.78rem;
  background: rgba(0, 0, 0, 0.22);
}

.sp-role-tile__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  /* Keep stats tight under the wallet — do not push to card bottom */
  margin-top: 0.35rem;
  padding-top: 0;
}

.sp-role-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0.55rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.sp-role-stat--wide {
  grid-column: 1 / -1;
}

.sp-role-stat--bal .sp-role-stat__value {
  font-size: 0.88rem;
}

.sp-role-stat--res {
  opacity: 0.95;
}

.sp-role-stat--res .sp-role-stat__value {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted) !important;
}

.sp-role-stat__label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.sp-role-stat__value {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  word-break: break-word;
}

.sp-role-tile--sponsor .sp-role-stat__value {
  color: #fde68a;
}

.sp-role-tile--sponsee .sp-role-stat__value {
  color: #99f6e4;
}

.sp-role-tile--control .sp-role-stat__value {
  color: #cbd5e1;
}

.sp-role-stat__value--muted {
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted) !important;
}

/* legacy flat role row (unused, keep for safety) */
.sp-roles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

@media (max-width: 720px) {
  .sp-roles {
    grid-template-columns: 1fr;
  }
}

.sp-stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
  margin-top: var(--space-4);
}

@media (max-width: 720px) {
  .sp-stat-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

.sp-stat {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  text-align: center;
  min-width: 0;
}

.sp-stat__label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 0.2rem;
}

.sp-stat__value {
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  word-break: break-word;
}

/* ── Collapsible folds ──────────────────────────────────────────────────── */

.sp-fold {
  margin: 0 0 var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.sp-fold--nested {
  margin: var(--space-4) 0 0;
  box-shadow: none;
  background: var(--bg-0);
  border-radius: var(--radius);
}

.sp-fold--mini {
  margin: 0 0 var(--space-3);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.sp-fold__summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  user-select: none;
  transition: background 0.15s;
}

.sp-fold--nested > .sp-fold__summary {
  padding: var(--space-3) var(--space-4);
}

.sp-fold--mini > .sp-fold__summary {
  padding: 0.45rem 0.65rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.sp-fold__summary::-webkit-details-marker {
  display: none;
}

.sp-fold__summary::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--text-dim);
  border-bottom: 2px solid var(--text-dim);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-left: auto;
  opacity: 0.7;
}

.sp-fold[open] > .sp-fold__summary::after {
  transform: rotate(-135deg);
  margin-top: 0.25rem;
}

.sp-fold__summary:hover {
  background: rgba(45, 212, 191, 0.04);
}

.sp-fold__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.sp-fold--mini .sp-fold__title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.sp-fold__hint {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 500;
  margin-right: 0.5rem;
}

@media (max-width: 540px) {
  .sp-fold__hint {
    display: none;
  }
}

.sp-fold__body {
  padding: 0 var(--space-5) var(--space-5);
  border-top: 1px solid var(--border);
}

.sp-fold--nested > .sp-fold__body {
  padding: var(--space-3) var(--space-4) var(--space-4);
}

.sp-fold--mini > .sp-fold__body {
  padding: 0.35rem 0.65rem 0.65rem;
  border-top: 1px solid var(--border);
}

.sp-fold__body--stack {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sp-fold__lead {
  margin: var(--space-3) 0 var(--space-4);
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.sp-activity-fold {
  margin-top: var(--space-5);
}

.sp-activity-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

/* ── Layer map ──────────────────────────────────────────────────────────── */

.sp-layer-map__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}

@media (max-width: 960px) {
  .sp-layer-map__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 540px) {
  .sp-layer-map__grid {
    grid-template-columns: 1fr;
  }
}

/* Open layers by default on wide screens for polish */
@media (min-width: 900px) {
  #sp-layers:not([data-user-toggled]) {
    /* leave closed by default for clean first paint; user expands */
  }
}

.sp-layer {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  min-height: 100%;
}

.sp-layer__tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sky);
  background: var(--sky-bg);
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  margin-bottom: 0.5rem;
}

.sp-layer__tag--pool {
  color: #99f6e4;
  background: var(--accent-glow);
  border-color: var(--border-strong);
}

.sp-layer__tag--obj {
  color: #c4b5fd;
  background: rgba(167, 139, 250, 0.12);
  border-color: rgba(167, 139, 250, 0.35);
}

.sp-layer__tag--acct {
  color: #fde68a;
  background: var(--amber-bg);
  border-color: rgba(251, 191, 36, 0.35);
}

.sp-layer__name {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.sp-layer__body {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.sp-layer__meta {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  padding-top: 0.55rem;
}

.sp-layer__meta li {
  margin: 0 0 0.28rem;
}

.sp-layer__meta li:last-child {
  margin-bottom: 0;
}

.sp-layer__meta strong {
  color: var(--text-muted);
  font-weight: 600;
}

.sp-layer-context {
  margin: 0 0 var(--space-4);
  padding: var(--space-4);
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.sp-layer-context p {
  margin: 0 0 0.65rem;
}

.sp-layer-context p:last-child {
  margin-bottom: 0;
}

.sp-layer-stack {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: rgba(45, 212, 191, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.sp-layer-stack__title {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.sp-layer-stack__list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.sp-layer-stack__list li {
  margin-bottom: 0.35rem;
}

.sp-layer-stack__list li:last-child {
  margin-bottom: 0;
}

/* ── Smart guide banner (walkthrough) ───────────────────────────────────── */

.sp-guide {
  margin: 0 0 var(--space-4);
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.12), rgba(125, 211, 252, 0.06));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}

.sp-experiments > .sp-guide {
  margin-top: 0;
}

.sp-guide__body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
}

.sp-guide__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
}

.sp-guide__heading {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.sp-guide__label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  font-weight: 700;
}

.sp-guide__track-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

.sp-guide__tracks {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.18rem;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 999px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.sp-guide-track {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.sp-guide-track:hover {
  color: var(--text);
}

.sp-guide-track.is-active {
  background: var(--accent);
  color: var(--bg-0);
}

.sp-guide__text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text);
}

.sp-guide__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

/* Horizontal progress: 1 Setup · 2 Prefund · 3 Use · 4 Delete */
.sp-guide__steps {
  list-style: none;
  margin: 0;
  padding: 0.55rem 0.5rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.sp-guide-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.35rem 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  line-height: 1.25;
  text-align: center;
}

.sp-guide-step__n {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-0);
  color: var(--text-dim);
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.sp-guide-step__label {
  display: block;
  min-width: 0;
  max-width: 100%;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.25;
  color: inherit;
  /* never glue to the number (was rendering as "2Prefund") */
  margin: 0;
  word-break: break-word;
}

.sp-guide-step__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sp-guide-step__join {
  display: none; /* connectors optional; grid is clearer on mobile */
}

.sp-guide-step.is-done {
  color: var(--green);
}

.sp-guide-step.is-done .sp-guide-step__n {
  background: var(--green-bg);
  border-color: rgba(74, 222, 128, 0.45);
  color: var(--green);
}

.sp-guide-step.is-current {
  color: var(--text);
}

.sp-guide-step.is-current .sp-guide-step__n {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-0);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.sp-guide-step.is-current .sp-guide-step__label {
  color: var(--text);
  font-weight: 700;
}

@media (max-width: 420px) {
  .sp-guide {
    padding: 0.75rem 0.7rem;
  }

  .sp-guide__top {
    flex-direction: column;
    align-items: stretch;
  }

  .sp-guide__tracks {
    width: 100%;
    display: flex;
  }

  .sp-guide-track {
    flex: 1 1 0;
    text-align: center;
    padding: 0.4rem 0.4rem;
  }

  .sp-guide__steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
    padding: 0.45rem;
  }

  .sp-guide-step {
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    gap: 0.45rem;
    padding: 0.4rem 0.45rem;
    background: rgba(0, 0, 0, 0.18);
    border-radius: 8px;
    border: 1px solid transparent;
  }

  .sp-guide-step.is-current {
    border-color: rgba(45, 212, 191, 0.35);
    background: rgba(45, 212, 191, 0.1);
  }

  .sp-guide-step.is-done {
    border-color: rgba(74, 222, 128, 0.25);
  }

  .sp-guide-step__label {
    font-size: 0.74rem;
  }

  .sp-guide__actions .sp-btn {
    width: 100%;
  }
}

/* ── Tips / hints / gotchas ─────────────────────────────────────────────── */

.sp-tip,
.sp-hint,
.sp-gotcha {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  line-height: 1.5;
  margin: 0 0 var(--space-4);
}

.sp-tip p,
.sp-hint p,
.sp-gotcha p,
.sp-path .sp-hint,
.sp-path .sp-gotcha,
.sp-path .sp-tip {
  margin: 0 0 var(--space-3);
}

.sp-path .sp-hint,
.sp-path .sp-gotcha,
.sp-path .sp-tip {
  margin-bottom: var(--space-3);
}

.sp-tip {
  background: var(--accent-glow);
  border: 1px solid var(--border-strong);
  color: #99f6e4;
}

.sp-hint {
  background: var(--sky-bg);
  border: 1px solid rgba(125, 211, 252, 0.25);
  color: #bae6fd;
}

.sp-gotcha {
  background: var(--amber-bg);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: #fde68a;
}

.sp-tip__label,
.sp-gotcha__label {
  flex: none;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.25);
  margin-top: 0.1rem;
}

.sp-tip > p,
.sp-gotcha > p {
  margin: 0;
  flex: 1;
}

/* ── Lab checklist ──────────────────────────────────────────────────────── */

.sp-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 var(--space-4);
  align-items: center;
}

.sp-checklist__label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-right: 0.15rem;
}

.sp-check {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  transition: color 0.15s, border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.sp-check.is-done {
  color: var(--green);
  background: var(--green-bg);
  border-color: rgba(74, 222, 128, 0.4);
}

.sp-check.is-done::before {
  content: "✓ ";
}

.sp-check.is-current {
  color: var(--text);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

/* ── Experiments ────────────────────────────────────────────────────────── */

.sp-experiments {
  margin-top: var(--space-5);
}

.sp-tabs-wrap {
  position: relative;
  margin-bottom: var(--space-5);
}

.sp-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  padding: 0.3rem;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}

.sp-tabs::-webkit-scrollbar {
  height: 4px;
}

.sp-tabs::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

.sp-tab {
  flex: 1 1 auto;
  min-width: fit-content;
  min-height: 2.5rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  scroll-snap-align: start;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

.sp-tab__short {
  display: none;
}

.sp-tab__full {
  display: inline;
}

.sp-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.sp-tab.is-active {
  color: var(--bg-0);
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.25);
}

.sp-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Tablet / large phone: wrap into a compact chip grid (no sideways hunt) */
@media (max-width: 720px) {
  .sp-tabs-wrap {
    margin-bottom: var(--space-4);
  }

  .sp-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.3rem;
    overflow: visible;
    scroll-snap-type: none;
    padding: 0.35rem;
  }

  .sp-tab {
    flex: none;
    min-width: 0;
    width: 100%;
    min-height: 2.65rem;
    padding: 0.45rem 0.3rem;
    font-size: 0.72rem;
    white-space: normal;
    text-align: center;
  }

  /* 7th tab (Guide) spans remaining row space on 4-col grid */
  .sp-tab[data-tab="learn"] {
    grid-column: span 1;
  }
}

/* ~390px phones: 2-row friendly 4-col grid + short labels */
@media (max-width: 420px) {
  .sp-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.28rem;
  }

  .sp-tab {
    min-height: 2.75rem;
    padding: 0.4rem 0.2rem;
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: 8px;
  }

  .sp-tab__full {
    display: none;
  }

  .sp-tab__short {
    display: inline;
  }

  .sp-tab.is-active {
    box-shadow: 0 0 0 2px var(--accent-glow);
  }
}

.sp-panel {
  display: none;
}

.sp-panel.is-active {
  display: block;
  animation: sp-fade 0.2s ease;
}

@keyframes sp-fade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.sp-panel h3 {
  margin: 0 0 var(--space-2);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.sp-panel__lead {
  margin: 0 0 var(--space-5);
  color: var(--text-muted);
  font-size: 0.925rem;
  line-height: 1.65;
  max-width: 52rem;
}

.sp-callout {
  border-radius: var(--radius-sm);
  padding: var(--space-4) var(--space-5);
  font-size: 0.85rem;
  line-height: 1.55;
  margin-bottom: var(--space-4);
}

.sp-callout--info {
  background: var(--sky-bg);
  border: 1px solid rgba(125, 211, 252, 0.25);
  color: #bae6fd;
}

.sp-callout--tip {
  background: var(--accent-glow);
  border: 1px solid var(--border-strong);
  color: #99f6e4;
}

.sp-callout--warn {
  background: var(--amber-bg);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: #fde68a;
}

.sp-callout strong {
  color: inherit;
}

.sp-code {
  font-family: var(--mono);
  font-size: 0.8em;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* ── Experiment path cards ──────────────────────────────────────────────── */

.sp-path-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  align-items: stretch;
}

@media (min-width: 820px) {
  .sp-path-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
  }
}

/* Keep paired lab cards (Co-sign / Prefund / Use) visually even */
.sp-path-grid > .sp-path {
  height: 100%;
}

.sp-path-grid > .sp-path .sp-path__body {
  min-height: 4.2em;
}

.sp-path-grid > .sp-path .sp-path__facts {
  flex: 1 1 auto;
}

.sp-path-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Manage · Sponsor / Sponsee: three compact cards in a row */
.sp-path-stack--3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  align-items: stretch;
}

@media (min-width: 720px) {
  .sp-path-stack--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
  }
}

.sp-path {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  min-height: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.sp-path--compact {
  padding: 0.7rem 0.75rem 0.75rem;
  min-width: 0;
}

.sp-path--compact .sp-path__head {
  gap: 0.3rem;
  margin-bottom: 0.4rem;
}

.sp-path--compact .sp-path__badge {
  font-size: 0.62rem;
  padding: 0.12rem 0.42rem;
}

.sp-path--compact .sp-path__title {
  font-size: 0.88rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.sp-path--compact .sp-path__body {
  margin: 0 0 0.45rem;
  font-size: 0.76rem;
  line-height: 1.4;
}

.sp-path--compact .sp-path__facts {
  margin: 0 0 0.55rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.7rem;
  line-height: 1.35;
}

.sp-path--compact .sp-path__facts li {
  margin: 0 0 0.22rem;
}

.sp-path--compact .sp-path__facts strong {
  min-width: 4.25rem;
  font-size: 0.68rem;
}

.sp-path--compact .sp-path__actions {
  gap: 0.35rem;
  padding-top: 0.15rem;
}

.sp-path--compact .sp-path__actions .sp-btn {
  flex: 1 1 auto;
  min-width: 0;
  justify-content: center;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
}

.sp-path--compact .sp-code {
  font-size: 0.72em;
  word-break: break-word;
}

.sp-path:hover {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.08);
}

.sp-path__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  margin-bottom: var(--space-3);
}

.sp-path__badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sky);
  background: var(--sky-bg);
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}

.sp-path__badge--reserve {
  color: #99f6e4;
  background: var(--accent-glow);
  border-color: var(--border-strong);
}

.sp-path__badge--object {
  color: #c4b5fd;
  background: rgba(167, 139, 250, 0.12);
  border-color: rgba(167, 139, 250, 0.35);
}

.sp-path__badge--warn {
  color: #fde68a;
  background: var(--amber-bg);
  border-color: rgba(251, 191, 36, 0.35);
}

.sp-path__title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.sp-path__body {
  margin: 0 0 var(--space-3);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.sp-path__facts {
  list-style: none;
  margin: 0 0 var(--space-4);
  padding: 0.65rem 0.75rem;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.sp-path__facts li {
  margin: 0 0 0.4rem;
  padding-left: 0;
}

.sp-path__facts li:last-child {
  margin-bottom: 0;
}

.sp-path__facts strong {
  color: var(--text);
  font-weight: 600;
  display: inline-block;
  min-width: 7.5rem;
}

@media (max-width: 480px) {
  .sp-path__facts strong {
    display: block;
    min-width: 0;
    margin-bottom: 0.1rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-dim);
  }
}

.sp-path__note {
  margin: 0 0 var(--space-3);
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-dim);
}

/* ── Path pick + published results ─────────────────────────────────────── */

.sp-path-pick {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.sp-path-card {
  background: var(--bg-0);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sp-path-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.sp-path-card__badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.15);
  color: var(--accent);
  border: 1px solid rgba(45, 212, 191, 0.35);
}

.sp-path-card__badge--pool {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.35);
}

.sp-path-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.sp-path-card__body {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.sp-path-card__meta {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-dim);
}

.sp-path-card__actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sp-path-card__actions a.sp-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.sp-path-compare {
  margin: 0 0 var(--space-4);
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
}

.sp-path-compare__title {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.sp-table--compact th,
.sp-table--compact td {
  font-size: 0.78rem;
  padding: 0.4rem 0.5rem;
}

.sp-autorun__path-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: -0.35rem 0 0.65rem;
}

.sp-autorun__parties {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.75rem;
}

.sp-autorun__party {
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--bg-1);
}

.sp-autorun__party:hover {
  text-decoration: underline;
}

.sp-autorun__party--sponsor {
  color: #2dd4bf;
  border-color: rgba(45, 212, 191, 0.4);
  background: rgba(45, 212, 191, 0.08);
}

.sp-autorun__party--sponsee {
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.4);
  background: rgba(167, 139, 250, 0.08);
}

.sp-autorun__party--control {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.08);
}

.sp-autorun__party--openall {
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--bg-2);
}

.sp-live-run__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.sp-published {
  margin-top: var(--space-4);
  background: var(--bg-0);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
}

.sp-published__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.sp-published__title {
  margin: 0 0 0.3rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.sp-published__sub {
  margin: 0;
  max-width: 40rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.sp-published__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--space-4);
}

.sp-published__panel {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
}

.sp-published__panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
  font-size: 0.88rem;
  color: var(--text);
}

.sp-published__score {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--green);
}

.sp-published__score.is-err {
  color: var(--red);
}

.sp-published__parties {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.65rem;
  font-size: 0.74rem;
  color: var(--text-dim);
}

.sp-published__parties a {
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}

.sp-published__parties a:hover {
  text-decoration: underline;
}

.sp-published__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 18rem;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.sp-published__steps li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.55rem;
  padding: 0.35rem 0.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.76rem;
  color: var(--text-muted);
  background: var(--bg-0);
}

.sp-published__steps li.is-ok {
  border-color: rgba(74, 222, 128, 0.2);
}

.sp-published__steps li.is-fail {
  border-color: rgba(248, 113, 113, 0.3);
  color: var(--red);
}

.sp-published__steps .sp-pub-id {
  font-weight: 700;
  font-family: ui-monospace, monospace;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.sp-published__steps a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.sp-published__steps a:hover {
  text-decoration: underline;
}

.sp-published__dl {
  margin-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.sp-published__meta {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}

/* ── Autorun full demo ──────────────────────────────────────────────────── */

.sp-autorun {
  background: var(--bg-0);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
}

.sp-autorun__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
}

.sp-autorun__title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.sp-autorun__sub {
  margin: 0;
  max-width: 36rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.sp-autorun__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sp-autorun__status {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: var(--space-3);
  padding: 0.5rem 0.65rem;
  background: var(--accent-glow);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.sp-autorun__status.is-err {
  color: var(--red);
  background: var(--red-bg);
  border-color: rgba(248, 113, 113, 0.35);
}

.sp-autorun__status.is-ok {
  color: var(--green);
  background: var(--green-bg);
  border-color: rgba(74, 222, 128, 0.35);
}

.sp-autorun__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sp-autorun__list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.sp-autorun__label {
  flex: 1 1 10rem;
  min-width: 0;
}

.sp-autorun__tx {
  flex: none;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(45, 212, 191, 0.35);
  background: rgba(45, 212, 191, 0.1);
}

.sp-autorun__tx:hover {
  text-decoration: underline;
  background: rgba(45, 212, 191, 0.18);
}

.sp-autorun__note {
  flex: none;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-dim);
}

.sp-autorun__note.is-err {
  color: var(--red);
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Last live run panel (this browser) */
.sp-live-run {
  margin-top: var(--space-4);
  background: var(--bg-0);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
}

.sp-live-run__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.sp-live-run__title {
  margin: 0 0 0.3rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.sp-live-run__sub {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sp-live-run__list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 14rem;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.sp-live-run__list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.65rem;
  padding: 0.35rem 0.45rem;
  border-radius: var(--radius-sm);
  background: var(--bg-1);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.sp-live-run__list li.is-ok {
  border-color: rgba(74, 222, 128, 0.25);
}

.sp-live-run__list li.is-fail {
  border-color: rgba(248, 113, 113, 0.35);
  color: var(--red);
}

.sp-live-run__list a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.sp-live-run__list a:hover {
  text-decoration: underline;
}

.sp-live-run__note {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.sp-autorun__n {
  flex: none;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--bg-3);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.sp-autorun__list li.is-current {
  background: rgba(45, 212, 191, 0.1);
  border-color: var(--border-strong);
  color: var(--text);
}

.sp-autorun__list li.is-current .sp-autorun__n {
  background: var(--accent);
  color: var(--bg-0);
  border-color: var(--accent);
}

.sp-autorun__list li.is-done {
  color: var(--green);
}

.sp-autorun__list li.is-done .sp-autorun__n {
  background: var(--green-bg);
  color: var(--green);
  border-color: rgba(74, 222, 128, 0.4);
}

.sp-autorun__list li.is-done .sp-autorun__n::after {
  content: none;
}

.sp-autorun__list li.is-skip {
  opacity: 0.65;
}

.sp-autorun__list li.is-err {
  color: var(--red);
  border-color: rgba(248, 113, 113, 0.35);
  background: var(--red-bg);
}

.sp-autorun__list li.is-err .sp-autorun__n {
  background: var(--red-bg);
  color: var(--red);
  border-color: rgba(248, 113, 113, 0.45);
}

@media (max-width: 640px) {
  .sp-autorun__actions {
    width: 100%;
  }

  .sp-autorun__actions .sp-btn {
    flex: 1 1 auto;
  }
}

.sp-path__list {
  margin: 0 0 var(--space-4);
  padding-left: 1.15rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.sp-path__list li {
  margin-bottom: 0.4rem;
}

.sp-path__list li:last-child {
  margin-bottom: 0;
}

.sp-path__list--ordered {
  list-style: decimal;
}

.sp-path__fields {
  margin-bottom: var(--space-4);
}

.sp-path__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: var(--space-2);
}

.sp-path__actions .sp-btn {
  flex: 1 1 auto;
  min-width: min(100%, 12rem);
}

/* ── Guide collapsible sections ─────────────────────────────────────────── */

.sp-guide-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.85rem;
}

.sp-guide-head h3 {
  margin: 0 0 0.25rem;
}

.sp-guide-head .sp-panel__lead {
  margin: 0;
  max-width: 36rem;
}

.sp-guide-head__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex-shrink: 0;
}

.sp-guide-fold {
  margin-bottom: 0.65rem;
}

.sp-path-card__more {
  margin-top: 0.65rem;
}

.sp-path-card__more > .sp-fold__summary {
  padding: 0.35rem 0.5rem;
}

.sp-path-card__more .sp-path-card__body {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.sp-walkthrough-block > .sp-fold--mini {
  margin-bottom: 0.4rem;
}

.sp-walkthrough-block > .sp-fold--mini:last-child {
  margin-bottom: 0;
}

/* ── Path walkthrough lists (Lab / Guide) ───────────────────────────────── */

.sp-walkthrough {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.sp-walkthrough li {
  margin: 0.25rem 0;
}

.sp-walkthrough strong {
  color: var(--text);
}

.sp-walkthrough-block {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.sp-walkthrough-block__title {
  margin: 0.75rem 0 0.4rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.sp-walkthrough-block__title:first-child {
  margin-top: 0;
}

/* ── Live submit pipeline dock ──────────────────────────────────────────── */

.sp-submit-dock {
  margin: var(--space-5) 0 var(--space-4);
  background: var(--bg-0);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.04);
  /* Clear sticky site header when scrolled into view */
  scroll-margin-top: calc(var(--header-h) + 0.85rem);
}

.sp-submit-dock[data-state='busy'] {
  border-color: rgba(45, 212, 191, 0.55);
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.12), 0 8px 28px rgba(0, 0, 0, 0.25);
}

/*
 * Submit zone: pin the pipeline under the sticky header (with a real gap)
 * so path runs / txs do not jump and the dock is never covered by nav.
 */
body.sponsor-submit-zone .sp-submit-dock {
  position: sticky;
  top: calc(var(--header-h) + 0.75rem);
  z-index: 40; /* below .sp-header (50) */
  max-height: calc(100vh - var(--header-h) - 1.5rem);
  overflow-y: auto;
  margin-top: var(--space-4);
  margin-bottom: var(--space-4);
  border-color: rgba(45, 212, 191, 0.55);
  box-shadow:
    0 0 0 1px rgba(45, 212, 191, 0.14),
    0 12px 36px rgba(0, 0, 0, 0.35);
}

body.sponsor-submit-zone .sp-submit-dock__bar {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg-0);
  backdrop-filter: blur(8px);
}

/* Compact path-run status under Guide run buttons (no live step list) */
.sp-path-run-status {
  margin: 0.65rem 0 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.sp-path-run-status--sub {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.sp-path-run-status.is-ok {
  color: var(--green);
}

.sp-path-run-status.is-err {
  color: var(--red);
}

.sp-submit-dock[data-state='ok'] {
  border-color: rgba(74, 222, 128, 0.45);
}

.sp-submit-dock[data-state='err'] {
  border-color: rgba(248, 113, 113, 0.5);
}

.sp-submit-dock__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(180deg, rgba(45, 212, 191, 0.06), transparent);
  border-bottom: 1px solid var(--border);
}

.sp-submit-dock__identity {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  min-width: 0;
  flex: 1 1 14rem;
}

.sp-submit-dock__pulse {
  flex: none;
  width: 0.7rem;
  height: 0.7rem;
  margin-top: 0.35rem;
  border-radius: 50%;
  background: var(--text-dim);
  border: 1px solid var(--border);
}

.sp-submit-dock[data-state='busy'] .sp-submit-dock__pulse {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.55);
  animation: sp-pulse 1.2s ease-out infinite;
}

.sp-submit-dock[data-state='ok'] .sp-submit-dock__pulse {
  background: var(--green);
  border-color: var(--green);
}

.sp-submit-dock[data-state='err'] .sp-submit-dock__pulse {
  background: var(--red);
  border-color: var(--red);
}

@keyframes sp-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.55);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(45, 212, 191, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(45, 212, 191, 0);
  }
}

.sp-submit-dock__phase {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.sp-submit-dock[data-state='ok'] .sp-submit-dock__phase {
  color: var(--green);
}

.sp-submit-dock[data-state='err'] .sp-submit-dock__phase {
  color: var(--red);
}

.sp-submit-dock[data-state='idle'] .sp-submit-dock__phase {
  color: var(--text-dim);
}

.sp-submit-dock__title {
  margin-top: 0.15rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  word-break: break-word;
}

.sp-submit-dock__bar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.sp-submit-dock__link {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(45, 212, 191, 0.35);
  background: rgba(45, 212, 191, 0.1);
}

.sp-submit-dock__link:hover {
  text-decoration: underline;
}

.sp-submit-dock__history {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  padding: 0.55rem 0.85rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background: var(--bg-1);
  min-height: 2.4rem;
}

.sp-submit-dock__history:empty {
  display: none;
}

.sp-submit-dock__chip {
  flex: none;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: inherit;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-0);
  color: var(--text-muted);
  cursor: pointer;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-submit-dock__chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.sp-submit-dock__chip.is-active {
  border-color: rgba(45, 212, 191, 0.55);
  background: rgba(45, 212, 191, 0.12);
  color: var(--text);
}

.sp-submit-dock__chip.is-ok:not(.is-active) {
  border-color: rgba(74, 222, 128, 0.3);
}

.sp-submit-dock__chip.is-err:not(.is-active) {
  border-color: rgba(248, 113, 113, 0.4);
  color: var(--red);
}

.sp-submit-dock__chip.is-busy {
  border-color: rgba(45, 212, 191, 0.45);
  color: var(--accent);
}

.sp-submit-dock__hist-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  min-width: 3rem;
  text-align: center;
}

.sp-submit-dock__steps {
  list-style: none;
  margin: 0;
  padding: 0.65rem 0.85rem;
  display: grid;
  /* Pipeline is always 3 steps */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-1);
}

/* Description sits under the step tabs */
.sp-submit-dock__desc {
  padding: 0.75rem 0.9rem 0.55rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-muted);
  border-bottom: none;
  background: rgba(15, 23, 42, 0.35);
}

.sp-submit-dock__desc strong {
  color: var(--text);
}

.sp-submit-dock__steps li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-dim);
  padding: 0.4rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  min-width: 0;
}

.sp-submit-dock__steps li:hover {
  border-color: var(--border);
  background: var(--bg-0);
}

.sp-submit-dock__steps li.is-focus {
  border-color: rgba(45, 212, 191, 0.45);
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.12);
  background: rgba(45, 212, 191, 0.08);
}

.sp-submit-dock__step-label {
  font-weight: 700;
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-submit-dock__n {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.sp-submit-dock__steps li.is-current {
  color: var(--text);
  border-color: rgba(45, 212, 191, 0.35);
  background: rgba(45, 212, 191, 0.1);
}

.sp-submit-dock__steps li.is-current .sp-submit-dock__n {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-0);
}

.sp-submit-dock__steps li.is-done {
  color: var(--green);
}

.sp-submit-dock__steps li.is-done .sp-submit-dock__n {
  background: var(--green-bg);
  border-color: rgba(74, 222, 128, 0.45);
  color: var(--green);
}

.sp-submit-dock__steps li.is-err {
  color: var(--red);
  border-color: rgba(248, 113, 113, 0.35);
  background: var(--red-bg);
}

.sp-submit-dock__steps li.is-err .sp-submit-dock__n {
  background: var(--red-bg);
  border-color: rgba(248, 113, 113, 0.45);
  color: var(--red);
}

.sp-submit-dock__json-wrap {
  padding: 0.65rem 0.85rem 0.85rem;
}

.sp-submit-dock__json-wrap.is-collapsed {
  display: none;
}

.sp-submit-dock__json-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.sp-submit-dock__json-hint {
  font-weight: 500;
  color: var(--text-dim);
  font-size: 0.7rem;
}

.sp-submit-dock__json {
  margin: 0;
  max-height: min(36vh, 320px);
  overflow: auto;
  padding: 0.75rem 0.85rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.45;
  color: #a5f3fc;
  background: #0a0f18;
  border: 1px solid #1e293b;
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  word-break: break-word;
}

.sp-submit-dock__result {
  padding: 0.65rem 0.85rem 0.85rem;
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

.sp-submit-dock__result.is-ok {
  color: var(--green);
  background: rgba(74, 222, 128, 0.06);
}

.sp-submit-dock__result.is-err {
  color: var(--red);
  background: rgba(248, 113, 113, 0.08);
}

.sp-submit-dock__result a {
  color: var(--accent);
  font-weight: 700;
}

.sp-btn.is-busy {
  opacity: 0.92;
  cursor: wait;
  position: relative;
}

/* ── Activity ───────────────────────────────────────────────────────────── */

.sp-activity {
  margin-top: var(--space-6);
}

.sp-log {
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.5;
  max-height: min(52vh, 480px);
  overflow-y: auto;
  padding: var(--space-3);
  color: var(--text-dim);
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.sp-log__entry {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(45, 212, 191, 0.08);
  word-break: break-word;
}

.sp-log__entry:last-child {
  border-bottom: none;
}

.sp-log__explorer {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(45, 212, 191, 0.35);
  background: rgba(45, 212, 191, 0.1);
  vertical-align: middle;
}

.sp-log__explorer:hover {
  text-decoration: underline;
  background: rgba(45, 212, 191, 0.18);
}

.sp-log__msg {
  white-space: pre-wrap;
}

.sp-log__entry.ok .sp-log__msg {
  color: var(--green);
}

.sp-log__entry.err .sp-log__msg {
  color: var(--red);
}

.sp-log__entry.info .sp-log__msg {
  color: var(--text-muted);
}

.sp-log__entry.warn .sp-log__msg {
  color: var(--amber);
}

.sp-log__json {
  margin-top: 0.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
}

.sp-log__json summary {
  cursor: pointer;
  user-select: none;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0.35rem 0.55rem;
  list-style-position: outside;
  margin-left: 0.5rem;
}

.sp-log__json summary:hover {
  color: var(--text);
}

.sp-log__json pre {
  margin: 0;
  padding: 0.5rem 0.65rem 0.65rem;
  max-height: 18rem;
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.45;
  color: #b6cfcb;
  white-space: pre-wrap;
  word-break: break-word;
  border-top: 1px solid var(--border);
}

.sp-log a {
  color: var(--accent);
}

/* Legacy class hooks (if any plain text still uses them) */
.sp-log .ok {
  color: var(--green);
}

.sp-log .err {
  color: var(--red);
}

.sp-log .info {
  color: var(--text-muted);
}

.sp-log .warn {
  color: var(--amber);
}

/* ── Modal (centered both axes; scrollable when taller than viewport) ───── */

.sp-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(2, 8, 8, 0.75);
  backdrop-filter: blur(8px);
  /* Flex + margin:auto on child = true horizontal + vertical center.
     When the panel is taller than the viewport, overlay still scrolls. */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(var(--space-4), env(safe-area-inset-top, 0px))
    max(var(--space-4), env(safe-area-inset-right, 0px))
    max(var(--space-4), env(safe-area-inset-bottom, 0px))
    max(var(--space-4), env(safe-area-inset-left, 0px));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.sp-modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.sp-modal {
  width: 100%;
  max-width: 36rem;
  max-height: calc(100dvh - (var(--space-4) * 2) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--space-6);
  /* Keep centered even when overlay scrolls */
  margin: auto;
  flex-shrink: 0;
  align-self: center;
}

.sp-modal.is-error {
  border-color: rgba(248, 113, 113, 0.45);
}

.sp-modal.is-ok {
  border-color: rgba(74, 222, 128, 0.4);
}

.sp-modal.is-info {
  border-color: rgba(125, 211, 252, 0.4);
}

/* Compact notice modals (clear accounts, empty state, etc.) */
.sp-modal.is-simple {
  max-width: 28rem;
  padding: var(--space-5);
}

.sp-modal.is-simple .sp-modal__title {
  font-size: 1.1rem;
}

.sp-modal.is-simple .sp-modal__desc {
  margin-bottom: var(--space-3);
}

.sp-modal.is-simple .sp-modal__actions {
  margin-top: var(--space-4);
}

.sp-modal__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.sp-modal__heading {
  min-width: 0;
  flex: 1;
}

.sp-modal__title {
  margin: 0.35rem 0 0;
  font-size: 1.2rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
}

.sp-modal.is-error .sp-modal__title {
  color: #fecaca;
}

.sp-modal.is-info .sp-modal__title {
  color: #e0f2fe;
}

.sp-modal__top-right {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  flex-shrink: 0;
}

.sp-modal__acct-links {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sp-modal__acct-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  height: 1.85rem;
  padding: 0 0.45rem 0 0.35rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.sp-modal__acct-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(45, 212, 191, 0.12);
}

.sp-modal__acct-tag {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.sp-modal__acct-btn--sponsor {
  border-color: rgba(251, 191, 36, 0.3);
  color: #fde68a;
}

.sp-modal__acct-btn--sponsor:hover {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.5);
  color: #fde68a;
}

.sp-modal__acct-btn--sponsee {
  border-color: rgba(45, 212, 191, 0.3);
  color: #99f6e4;
}

.sp-modal__acct-btn--sponsee:hover {
  background: var(--accent-glow);
  border-color: rgba(45, 212, 191, 0.5);
  color: #99f6e4;
}

.sp-modal__acct-btn--control {
  border-color: rgba(148, 163, 184, 0.3);
  color: #cbd5e1;
}

.sp-modal__acct-btn--control:hover {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.5);
  color: #cbd5e1;
}

.sp-modal__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--accent-glow);
  color: var(--accent);
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.sp-modal__icon-btn:hover {
  background: rgba(45, 212, 191, 0.22);
  color: var(--text);
}

.sp-modal__tx {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin: 0 0 var(--space-4);
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.22);
}

.sp-modal__tx-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.sp-modal__tx-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.sp-modal__tx-hash {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

.sp-modal__tx-hash-link {
  color: inherit;
  text-decoration: none;
}

.sp-modal__tx-hash-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.sp-modal__close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 1.85rem;
  height: 1.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sp-modal__close:hover {
  color: var(--text);
}

.sp-modal__text-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.sp-modal__desc {
  margin: 0 0 var(--space-4);
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.sp-modal__tips {
  margin: 0 0 var(--space-4);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--accent-glow);
  border: 1px solid var(--border-strong);
  color: #99f6e4;
  font-size: 0.82rem;
  line-height: 1.5;
}

.sp-modal.is-error .sp-modal__tips {
  background: var(--amber-bg);
  border-color: rgba(251, 191, 36, 0.3);
  color: #fde68a;
}

.sp-modal__steps {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-4);
  counter-reset: st;
}

.sp-modal__steps li {
  position: relative;
  padding: 0.4rem 0 0.4rem 1.85rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-left: 2px solid var(--border);
  margin-left: 0.55rem;
}

.sp-modal__steps li::before {
  counter-increment: st;
  content: counter(st);
  position: absolute;
  left: -0.55rem;
  top: 0.4rem;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--bg-3);
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sp-modal__metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: var(--space-4);
}

.sp-modal__metrics:empty,
.sp-modal__steps:empty,
.sp-modal__links:empty {
  display: none !important;
  margin: 0 !important;
}

.sp-modal__metrics--one {
  grid-template-columns: 1fr;
}

.sp-modal__metrics--two {
  grid-template-columns: 1fr 1fr;
}

.sp-modal__metric-group {
  grid-column: 1 / -1;
  margin: 0.45rem 0 0.1rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sp-modal__metrics > .sp-modal__metric-group:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.sp-modal__metric--wide {
  grid-column: 1 / -1;
}

.sp-modal__metric {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  border-left: 3px solid var(--border-strong);
}

.sp-modal.is-simple .sp-modal__metric {
  background: rgba(125, 211, 252, 0.06);
  border-color: rgba(125, 211, 252, 0.22);
  border-left-width: 3px;
}

/* Role tones — match wallet cards */
.sp-modal__metric--sponsor {
  background: linear-gradient(165deg, rgba(251, 191, 36, 0.1), rgba(0, 0, 0, 0.12));
  border-color: rgba(251, 191, 36, 0.28);
  border-left-color: #fbbf24;
}

.sp-modal__metric--sponsee {
  background: linear-gradient(165deg, rgba(45, 212, 191, 0.1), rgba(0, 0, 0, 0.12));
  border-color: rgba(45, 212, 191, 0.28);
  border-left-color: #2dd4bf;
}

.sp-modal__metric--control {
  background: linear-gradient(165deg, rgba(148, 163, 184, 0.1), rgba(0, 0, 0, 0.12));
  border-color: rgba(148, 163, 184, 0.28);
  border-left-color: #94a3b8;
}

.sp-modal__metric-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

.sp-modal__metric--sponsor .sp-modal__metric-label {
  color: #fbbf24;
}

.sp-modal__metric--sponsee .sp-modal__metric-label {
  color: #2dd4bf;
}

.sp-modal__metric--control .sp-modal__metric-label {
  color: #94a3b8;
}

.sp-modal__metric-value {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
  margin-top: 0.2rem;
}

.sp-modal__metric--sponsor .sp-modal__metric-value {
  color: #fde68a;
}

.sp-modal__metric--sponsee .sp-modal__metric-value {
  color: #99f6e4;
}

.sp-modal__metric--control .sp-modal__metric-value {
  color: #cbd5e1;
}

/* Balance direction emphasis on top of role color */
.sp-modal__metric--flat .sp-modal__metric-value {
  color: var(--text-muted) !important;
  font-weight: 500;
}

.sp-modal__metric--down .sp-modal__metric-value {
  color: #fca5a5 !important;
}

.sp-modal__metric--up .sp-modal__metric-value {
  color: #86efac !important;
}

.sp-modal.is-info .sp-modal__metric-value {
  color: #7dd3fc;
}

.sp-modal.is-info .sp-modal__tips {
  background: var(--sky-bg);
  border-color: rgba(125, 211, 252, 0.3);
  color: #bae6fd;
}

.sp-modal__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin-bottom: var(--space-3);
}

.sp-modal__links[hidden] {
  display: none !important;
}

.sp-modal__downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 var(--space-4);
}

.sp-modal__downloads[hidden] {
  display: none !important;
}

/* Legacy big link chips no longer used for tx/accounts */
.sp-modal__links a:not(.sp-modal__text-link) {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.sp-modal__tech {
  margin-top: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
  padding: 0.35rem 0.5rem 0.5rem;
}

.sp-modal__tech summary {
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  padding: 0.35rem 0.25rem;
}

.sp-modal__tech summary:hover {
  color: var(--text);
}

.sp-modal__tech pre {
  margin: 0.35rem 0 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.45;
  background: var(--bg-0);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 0.75rem;
  overflow: auto;
  max-height: min(40vh, 16rem);
  color: #b6cfcb;
  white-space: pre-wrap;
  word-break: break-word;
}

.sp-modal__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-5);
  gap: 0.5rem;
}

@media (max-width: 540px) {
  .sp-modal {
    padding: var(--space-4);
    border-radius: var(--radius);
    max-height: calc(100dvh - 1.5rem);
  }

  .sp-modal__title {
    font-size: 1.05rem;
  }

  .sp-modal__metrics {
    grid-template-columns: 1fr;
  }

  .sp-modal__actions {
    flex-direction: column-reverse;
  }

  .sp-modal__actions .sp-btn {
    width: 100%;
  }

  .sp-modal__tech pre {
    max-height: min(32vh, 12rem);
  }

  .sp-modal__links a {
    flex: 1 1 auto;
    text-align: center;
  }
}

/* ── Utils ──────────────────────────────────────────────────────────────── */

.sp-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.sp-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-4) 0;
}

.sp-muted {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.sp-status-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

/* -- FAQ & documentation -------------------------------------------------- */

.sp-faq-card {
  margin-top: var(--space-5);
}

.sp-doc-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

@media (max-width: 720px) {
  .sp-doc-links {
    grid-template-columns: 1fr;
  }
}

.sp-doc-link {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: var(--space-4);
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.sp-doc-link:hover {
  border-color: var(--border-strong);
  background: rgba(45, 212, 191, 0.06);
  transform: translateY(-1px);
}

.sp-doc-link__label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
}

.sp-doc-link__meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.sp-faq {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sp-faq__item {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.sp-faq__item summary {
  list-style: none;
  cursor: pointer;
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  transition: background 0.15s;
}

.sp-faq__item summary::-webkit-details-marker {
  display: none;
}

.sp-faq__item summary::after {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-right: 2px solid var(--text-dim);
  border-bottom: 2px solid var(--text-dim);
  transform: rotate(45deg);
  flex-shrink: 0;
  transition: transform 0.2s;
  opacity: 0.7;
}

.sp-faq__item[open] summary::after {
  transform: rotate(-135deg);
  margin-top: 0.2rem;
}

.sp-faq__item summary:hover {
  background: rgba(45, 212, 191, 0.05);
}

.sp-faq__a {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.sp-faq__a p {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.sp-faq__a a {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.sp-faq__a a:hover {
  text-decoration: underline;
}

/* -- Path mini-folds ------------------------------------------------------ */

.sp-path .sp-fold--mini {
  width: 100%;
}

.sp-path .sp-path__list {
  margin-bottom: 0;
}

/* -- Smooth anchor scroll offset for sticky header ------------------------ */

[id^="sp-"] {
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

/* -- Reduced motion ------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

/* -- Reserves / concept explainers ---------------------------------------- */

.sp-concept {
  padding-top: var(--space-3);
}

.sp-concept__lead {
  margin: 0 0 var(--space-4);
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: none;
  width: 100%;
}

.sp-concept__lead strong {
  color: var(--text);
}

.sp-concept-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

@media (max-width: 720px) {
  .sp-concept-grid {
    grid-template-columns: 1fr;
  }
}

.sp-concept-card {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
}

.sp-concept-card--ok {
  border-color: rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.06);
}

.sp-concept-card--warn {
  border-color: rgba(251, 191, 36, 0.35);
  background: var(--amber-bg);
}

.sp-concept-card__title {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.sp-concept-card__body {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.sp-concept-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.sp-concept-list li {
  margin-bottom: 0.35rem;
}

.sp-concept-list li:last-child {
  margin-bottom: 0;
}

.sp-concept-sub {
  margin: 0 0 var(--space-3);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.sp-concept-foot {
  margin: var(--space-4) 0 0;
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.sp-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-0);
}

.sp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  line-height: 1.45;
  min-width: min(100%, 36rem);
}

@media (max-width: 540px) {
  .sp-table {
    min-width: 28rem; /* still scrolls inside .sp-table-wrap */
    font-size: 0.72rem;
  }

  .sp-table th,
  .sp-table td {
    padding: 0.5rem 0.55rem;
  }
}

.sp-table th,
.sp-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.sp-table th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.2);
  font-weight: 700;
}

.sp-table tr:last-child td {
  border-bottom: none;
}

.sp-table td strong {
  color: var(--text);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Mobile / narrow phones (390px class devices)
   Safe-area aware, no horizontal page scroll, stack & wrap everything.
   ═══════════════════════════════════════════════════════════════════════════ */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body.sponsor-app {
  overflow-x: clip;
}

img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

.sp-code,
code {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.sp-role-tile__addr,
.sp-submit-dock__json,
.sp-modal__tx-hash,
pre {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Fold titles must wrap on narrow screens */
.sp-fold__summary {
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
}

.sp-fold__title {
  min-width: 0;
  flex: 1 1 auto;
}

/* ── ≤420px: phone portrait (includes 390px) ────────────────────────────── */

@media (max-width: 420px) {
  :root {
    --header-h: 56px;
    --space-5: 0.9rem;
    --space-8: 1.35rem;
  }

  .sp-main {
    padding: 0.85rem 0.65rem 1.75rem;
  }

  .sp-header__inner {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
    gap: 0.4rem;
  }

  .sp-brand {
    font-size: 0.95rem;
    gap: 0.4rem;
    min-width: 0;
  }

  .sp-brand span {
    max-width: 7.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sp-brand img {
    width: 30px;
    height: 30px;
  }

  .sp-hero {
    margin-bottom: var(--space-5);
    text-align: left;
  }

  .sp-hero h1 {
    font-size: 1.4rem;
    line-height: 1.2;
  }

  .sp-hero__lead {
    font-size: 0.88rem;
  }

  .sp-hero__meta,
  .sp-hero__eyebrow {
    justify-content: flex-start;
    gap: 0.35rem 0.5rem;
  }

  .sp-card {
    padding: 0.85rem 0.75rem;
    border-radius: var(--radius);
  }

  .sp-card__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .sp-card__title {
    font-size: 1.05rem;
  }

  .sp-card__subtitle {
    font-size: 0.8rem;
  }

  /* Setup buttons full width */
  .sp-setup-actions,
  .sp-btn-row {
    flex-direction: column;
    align-items: stretch;
  }

  .sp-setup-actions .sp-btn,
  .sp-btn-row .sp-btn {
    width: 100%;
    min-width: 0;
  }

  /* Role tiles already 1-col under 900px; tighten padding */
  .sp-role-tile {
    padding: 0.75rem;
  }

  .sp-role-tile__stats {
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
  }

  /* Lab tabs: handled in main @media 720 / 420 blocks */

  .sp-panel h3 {
    font-size: 1.05rem;
  }

  .sp-panel__lead {
    font-size: 0.84rem;
  }

  /* Path / lab cards stack fully */
  .sp-path-grid,
  .sp-path-stack--3,
  .sp-path-pick,
  .sp-published__grid {
    grid-template-columns: 1fr !important;
    gap: 0.65rem;
  }

  .sp-path,
  .sp-path--compact,
  .sp-path-card {
    padding: 0.75rem;
  }

  .sp-path__title,
  .sp-path-card__title {
    font-size: 0.92rem;
  }

  .sp-path__body,
  .sp-path-card__body {
    font-size: 0.78rem;
    min-height: 0 !important;
  }

  .sp-path__facts {
    font-size: 0.72rem;
    padding: 0.45rem 0.55rem;
  }

  .sp-path__facts strong {
    min-width: 0;
    display: block;
    margin-bottom: 0.05rem;
  }

  .sp-path__actions,
  .sp-path-card__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .sp-path__actions .sp-btn,
  .sp-path-card__actions .sp-btn {
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
  }

  /* Concept / layer grids */
  .sp-concept-grid,
  .sp-layer-map__grid {
    grid-template-columns: 1fr !important;
  }

  /* Submit pipeline dock */
  .sp-submit-dock {
    margin: 0.75rem 0;
    border-radius: var(--radius-sm);
  }

  body.sponsor-submit-zone .sp-submit-dock {
    top: calc(var(--header-h) + 0.5rem);
    max-height: calc(100dvh - var(--header-h) - 1rem);
    margin-left: 0;
    margin-right: 0;
  }

  .sp-submit-dock__bar {
    padding: 0.65rem 0.7rem;
    gap: 0.5rem;
  }

  .sp-submit-dock__identity {
    flex: 1 1 100%;
  }

  .sp-submit-dock__title {
    font-size: 0.82rem;
    line-height: 1.35;
  }

  .sp-submit-dock__bar-actions {
    width: 100%;
    justify-content: flex-start;
    gap: 0.3rem;
  }

  .sp-submit-dock__bar-actions .sp-btn {
    flex: 1 1 auto;
    min-width: 0;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
    font-size: 0.7rem;
  }

  .sp-submit-dock__steps {
    padding: 0.5rem;
    gap: 0.25rem;
  }

  .sp-submit-dock__steps li {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.25rem;
    padding: 0.4rem 0.2rem;
    font-size: 0.65rem;
  }

  .sp-submit-dock__step-label {
    white-space: normal;
    line-height: 1.2;
  }

  .sp-submit-dock__desc {
    padding: 0.6rem 0.7rem;
    font-size: 0.78rem;
  }

  .sp-submit-dock__json-wrap,
  .sp-submit-dock__result {
    padding: 0.55rem 0.7rem 0.7rem;
  }

  .sp-submit-dock__json {
    max-height: min(42vh, 260px);
    font-size: 0.65rem;
    padding: 0.55rem 0.6rem;
  }

  .sp-submit-dock__history {
    padding: 0.4rem 0.5rem;
  }

  .sp-submit-dock__chip {
    max-width: 10rem;
    font-size: 0.65rem;
  }

  /* FAQ / docs */
  .sp-doc-links {
    gap: 0.5rem;
  }

  .sp-doc-link {
    padding: 0.75rem;
  }

  .sp-faq__item summary {
    font-size: 0.88rem;
    padding: 0.75rem 0.65rem;
    line-height: 1.35;
  }

  .sp-faq__a {
    padding: 0 0.65rem 0.85rem;
    font-size: 0.84rem;
  }

  /* Modal: fit small screens */
  .sp-modal {
    max-width: calc(100vw - 1.2rem);
    margin: 0.6rem;
    max-height: calc(100dvh - 1.2rem);
  }

  .sp-modal__title {
    font-size: 1rem;
  }

  .sp-footer {
    padding: 1rem 0.75rem;
    font-size: 0.75rem;
  }

  /* Layer / concept cards */
  .sp-layer,
  .sp-concept-card {
    padding: 0.75rem;
  }

  .sp-fold__body {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .sp-fold--mini > .sp-fold__body {
    padding: 0.35rem 0.55rem 0.55rem;
  }

  /* Pre / mono blobs */
  pre,
  .sp-log {
    max-width: 100%;
    overflow-x: auto;
  }
}

/* Slightly roomier 421–640 still single-column friendly */
@media (max-width: 640px) {
  .sp-path-grid > .sp-path .sp-path__body {
    min-height: 0;
  }

  .sp-submit-dock__bar-actions {
    flex-wrap: wrap;
  }

  body.sponsor-submit-zone .sp-submit-dock {
    max-height: calc(100dvh - var(--header-h) - 1.25rem);
  }
}

/* iOS safe areas */
@supports (padding: env(safe-area-inset-bottom)) {
  .sp-main {
    padding-left: max(var(--space-3), env(safe-area-inset-left));
    padding-right: max(var(--space-3), env(safe-area-inset-right));
  }

  .sp-header__inner {
    padding-left: max(var(--space-4), env(safe-area-inset-left));
    padding-right: max(var(--space-4), env(safe-area-inset-right));
  }

  .sp-footer {
    padding-bottom: max(var(--space-6), env(safe-area-inset-bottom));
  }

  body.sponsor-submit-zone .sp-submit-dock {
    top: calc(var(--header-h) + 0.5rem + env(safe-area-inset-top));
  }
}
