:root {
  color-scheme: light;
  --ink: #1a1d2c;
  --muted: #6b7184;
  --accent: #ff7a18;
  --accent-dark: #e05b00;
  --panel: rgba(255, 255, 255, 0.84);
  --panel-border: rgba(24, 29, 46, 0.12);
  --shadow: 0 20px 60px rgba(24, 29, 46, 0.12);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 196, 128, 0.35), transparent 45%),
    radial-gradient(circle at 85% 15%, rgba(120, 170, 255, 0.25), transparent 50%),
    radial-gradient(circle at 30% 80%, rgba(255, 110, 68, 0.18), transparent 55%),
    linear-gradient(160deg, #f5efe6 0%, #eef2f8 45%, #eceaf6 100%);
  min-height: 100vh;
}

.ambient {
  position: fixed;
  inset: 0;
  height: 100vh;
  background:
    radial-gradient(circle at 18% 30%, rgba(255, 126, 71, 0.22), transparent 55%),
    radial-gradient(circle at 85% 20%, rgba(41, 67, 240, 0.16), transparent 60%),
    radial-gradient(circle at 70% 80%, rgba(28, 180, 140, 0.14), transparent 55%);
  z-index: -1;
}

.ambient::before {
  content: "";
  position: absolute;
  inset: 0;
  background: conic-gradient(from 120deg at 50% 40%, rgba(255, 140, 80, 0.14), transparent 45%, rgba(90, 140, 255, 0.18), transparent 70%);
  filter: blur(10px);
  opacity: 0.7;
  pointer-events: none;
}

.ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='0.12'/></svg>");
  mix-blend-mode: multiply;
  opacity: 0.25;
  pointer-events: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 40px;
  padding: 64px 8vw 40px;
  align-items: start;
}

.hero-panel {
  margin-top: 18px;
}

.hero h1 {
  font-family: "DM Serif Display", serif;
  font-size: clamp(2.5rem, 4vw, 4rem);
  line-height: 1.05;
  margin: 12px 0 18px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

.lede {
  max-width: 560px;
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin: 24px 0 16px;
  flex-wrap: wrap;
}

.snap-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
  flex-wrap: wrap;
}

.actions.hidden {
  display: none;
}

.actions a.ghost {
  text-decoration: none;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.request-panel .hint {
  margin: 2px 0 0;
}

#request-hint {
  margin-top: 2px;
}

.request-panel .hint:empty {
  display: none;
}

.toggle input {
  width: 16px;
  height: 16px;
}

.primary,
.ghost {
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}

.primary {
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow);
}

.primary:hover {
  background: var(--accent-dark);
}

.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(26, 29, 44, 0.2);
}

.hero-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-meta span {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.82rem;
}

.hero-panel .panel span {
  word-break: break-word;
}

.hero-panel .panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.compact-list {
  margin: 0 0 8px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.info-panel {
  margin-bottom: 16px;
}

.market-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 18px;
}

.market-label {
  font-weight: 600;
  color: var(--muted);
}

.market-note {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--muted);
}

.pagination {
  display: none;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.pagination button {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(26, 29, 44, 0.2);
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}

.pagination button.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.ghost.pressed {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.hidden {
  display: none;
}

.panel h2,
.panel h3 {
  margin-top: 0;
  font-family: "DM Serif Display", serif;
}

.status {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.status .label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 4px;
}

.layout {
  padding: 0 8vw 80px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.request {
  margin-top: 24px;
  padding-top: 16px;
}

.section-title h2 {
  font-family: "DM Serif Display", serif;
  font-size: 2rem;
  margin-bottom: 6px;
}

.section-title p {
  color: var(--muted);
  margin-top: 0;
}

.agent-grid {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x mandatory;
}

.agent-card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 18px;
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 260px;
  max-width: 300px;
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.agent-card .meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.agent-card .pill {
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(26, 29, 44, 0.08);
}

.agent-card .score {
  font-size: 0.9rem;
  color: var(--muted);
}

.agent-card button {
  margin-top: auto;
}

.request-panel {
  background: var(--panel);
  border-radius: var(--radius);
  border: 1px solid var(--panel-border);
  padding: 22px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field.inline {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
}

textarea,
select {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(26, 29, 44, 0.2);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.95rem;
}

input {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(26, 29, 44, 0.2);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.95rem;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.mode-toggle {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.mode-toggle .active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.mode-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(26, 29, 44, 0.15);
  border-radius: 999px;
  transition: 0.2s;
}

.slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.switch input:checked + .slider {
  background: var(--ink);
}

.switch input:checked + .slider::before {
  transform: translateX(22px);
}

.credits-panel {
  border: 1px dashed rgba(26, 29, 44, 0.25);
  border-radius: 16px;
  padding: 12px;
  display: grid;
  gap: 10px;
  background: rgba(255, 255, 255, 0.55);
}

.credits-panel.hidden {
  display: none;
}

.credits-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.credits-balance {
  font-size: 0.9rem;
  color: var(--muted);
}


.credits-panel input {
  min-width: 260px;
}

.credits-note {
  font-size: 0.8rem;
  color: var(--muted);
}

.relayer-pill {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(26, 29, 44, 0.08);
  color: var(--muted);
}

.hint {
  font-size: 0.85rem;
  color: var(--muted);
}

#request-hint,
#attest-hint {
  margin: 4px 0;
}

.output-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.output-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0 16px;
}

.output-actions .field.inline {
  margin: 0;
}

.trust-grid {
  gap: 28px;
  margin-top: 10px;
}

.trust-grid .panel {
  display: flex;
  flex-direction: column;
  min-height: 440px;
  max-height: 560px;
  overflow: hidden;
}

.trust-grid .leaderboard {
  overflow-y: auto;
}

.tab-bar {
  display: flex;
  gap: 10px;
  margin: 14px 0 22px;
  flex-wrap: wrap;
}

.tab {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(26, 29, 44, 0.2);
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-weight: 600;
}

.tab.active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

.tab-panel.hidden {
  display: none;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ghost.small {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.scroll-feed {
  flex: 1;
  max-height: none;
  overflow-y: auto;
  padding-right: 6px;
}

.proof-preview {
  max-height: 320px;
  overflow-y: auto;
}

.tooltip {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  color: var(--accent-dark);
  font-weight: 600;
  cursor: help;
  position: relative;
}

.tooltip::after {
  content: attr(data-tip);
  position: absolute;
  left: 0;
  top: 130%;
  min-width: 220px;
  max-width: 260px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(26, 29, 44, 0.92);
  color: #fff;
  font-size: 0.75rem;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: 0.2s ease;
  z-index: 20;
}

.tooltip:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.inline-code {
  background: rgba(26, 29, 44, 0.08);
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.8rem;
  overflow-x: auto;
  margin-top: 8px;
}

.doc-link {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 600;
}

.output-grid .panel {
  background: var(--panel);
  border-radius: var(--radius);
  border: 1px solid var(--panel-border);
  padding: 20px;
  box-shadow: var(--shadow);
}

.leaderboard {
  display: grid;
  gap: 12px;
}

.leaderboard-row {
  border: 1px solid rgba(26, 29, 44, 0.12);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.7);
}

.leaderboard-row strong {
  display: block;
  font-size: 1rem;
}

.leaderboard-row .meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 4px;
}

.leaderboard-row .badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(255, 122, 24, 0.15);
  font-size: 0.7rem;
  font-weight: 600;
  color: #b44a00;
  margin-left: 6px;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 0.9rem;
  margin-right: 10px;
}

.attest-highlight {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: none;
}

#output-status.empty {
  color: var(--muted);
}

.output-item {
  padding: 10px 0;
  border-bottom: 1px solid rgba(26, 29, 44, 0.08);
}

.output-item:last-child {
  border-bottom: none;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.85rem;
  color: #2f3446;
}

.footer {
  padding: 40px 8vw 60px;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    margin-top: 8px;
  }

  .request {
    margin-top: 12px;
    padding-top: 8px;
  }
}
