/* Bitcoin Universe test apps — shared design tokens (match test inscribe) */
:root {
  --bu-pink: #ff0066;
  --bu-pink-soft: #ff8ab8;
  --bu-bg: #09090d;
  --bu-panel: #111115;
  --bu-panel-2: #0d0d10;
  --bu-border: #2d2f3a;
  --bu-text: #ffffff;
  --bu-muted: #a1a1aa;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: var(--bu-bg) !important;
  color: var(--bu-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  overflow-x: hidden;
  max-width: 100vw;
}

#root,
#app,
main,
[role="main"] {
  max-width: 100vw;
  overflow-x: clip;
}

/* Legacy orange / prod pink → test inscribe pink */
.bg-primary,
.from-primary,
[class*="bg-primary"],
[class*="from-[#E40071]"],
[class*="bg-[#E40071]"] {
  background-color: var(--bu-pink) !important;
}

.text-primary,
.border-primary,
[class*="text-[#E40071]"],
[class*="border-[#E40071]"] {
  color: var(--bu-pink) !important;
  border-color: var(--bu-pink) !important;
}

a {
  -webkit-tap-highlight-color: transparent;
}

/* Mobile tables */
.bu-table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 0.5rem;
}

.bu-table-scroll table {
  min-width: 640px;
}

/* Test suite nav pill */
.bu-test-nav {
  position: fixed;
  right: max(0.75rem, env(safe-area-inset-right));
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  z-index: 99990;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  pointer-events: none;
}

.bu-test-nav__toggle,
.bu-test-nav__links a {
  pointer-events: auto;
}

.bu-test-nav__toggle {
  border: 1px solid rgba(255, 0, 102, 0.45);
  background: rgba(17, 17, 21, 0.96);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.bu-test-nav__links {
  display: none;
  flex-direction: column;
  gap: 0.35rem;
  align-items: stretch;
  min-width: 10.5rem;
}

.bu-test-nav.is-open .bu-test-nav__links {
  display: flex;
}

.bu-test-nav__links a {
  display: block;
  text-align: center;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid var(--bu-border);
  background: rgba(13, 13, 16, 0.98);
  color: var(--bu-pink-soft);
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
}

.bu-test-nav__links a:hover,
.bu-test-nav__links a.bu-active {
  border-color: rgba(255, 0, 102, 0.45);
  background: rgba(255, 0, 102, 0.1);
  color: #fff;
}

/* Mobile spacing — avoid content under fixed CTAs / test nav */
@media (max-width: 640px) {
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .bu-test-nav {
    bottom: max(4.5rem, calc(env(safe-area-inset-bottom) + 3.5rem));
  }

  input,
  select,
  textarea,
  button {
    font-size: 16px !important; /* prevent iOS zoom on focus */
  }

  table {
    font-size: 0.8rem;
  }

  h1 {
    font-size: clamp(1.35rem, 6vw, 2rem) !important;
  }
}

@media (min-width: 641px) {
  .bu-test-nav {
    top: max(4.5rem, env(safe-area-inset-top));
    bottom: auto;
  }
}
