:root {
  --bg: #f8fafc;
  --bg-soft: #f1f5f9;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --text: #0f172a;
  --text-soft: #334155;
  --text-muted: #64748b;
  --line: #dbe3ee;
  --line-strong: #c8d5e5;
  --brand: #1d4ed8;
  --brand-soft: #eaf1ff;
  --brand-ink: #1e3a8a;
  --success: #1d8f59;
  --warning: #9c6207;
  --error: #bf384d;
  --radius-lg: 14px;
  --radius-md: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Manrope', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 251, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-content {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--brand);
  border: 0;
  font-family: 'Manrope', sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
}

.nav {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.nav-toggle:hover {
  border-color: #b4c9de;
}

.nav-link {
  text-decoration: none;
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 600;
}

.nav-link:hover {
  color: var(--brand-ink);
}

.wallet-btn {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.wallet-btn:hover {
  transform: translateY(-1px);
  border-color: #b4c9de;
  box-shadow: var(--shadow-sm);
}

.wallet-btn.connected {
  background: #eaf6ef;
  color: #125b35;
  border-color: #b7dfc8;
}

main {
  padding-bottom: 48px;
}

.hero {
  padding: 48px 0 24px;
}

.hero-shell {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 34px 32px;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d5e2f7;
  background: #f8fbff;
  color: #35527a;
  font-family: 'Manrope', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 8px 12px;
  margin-bottom: 18px;
}

.hero-title {
  font-size: clamp(1.9rem, 4.8vw, 3.2rem);
  line-height: 1.08;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
  max-width: 920px;
}

.hero-subtitle {
  max-width: 780px;
  color: var(--text-soft);
  font-size: 1rem;
}

.hero-actions {
  margin-top: 24px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-inventory {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #ffffff;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.hero-inventory-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-inventory-copy strong {
  font-size: 0.78rem;
  color: var(--text);
  letter-spacing: 0.02em;
}

.hero-inventory-copy span {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.hero-metrics {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.hero-metrics div {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #ffffff;
  padding: 12px;
}

.hero-metrics strong {
  display: block;
  color: var(--brand-ink);
  text-transform: uppercase;
  font-family: 'Manrope', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.hero-metrics span {
  color: var(--text-muted);
  font-size: 0.74rem;
}

.workflow-section,
.souls-section,
.agent-api-section {
  padding: 24px 0;
}

.section-head {
  margin-bottom: 16px;
}

.section-head h2 {
  font-size: clamp(1.35rem, 3.8vw, 2rem);
  margin-bottom: 6px;
}

.section-head p {
  color: var(--text-soft);
}

.section-head p + p {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.workflow-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}

.workflow-card h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.workflow-card p {
  color: var(--text-soft);
  font-size: 0.92rem;
}

.souls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
}

.soul-card,
.agent-api-card,
.soul-preview,
.purchase-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.soul-card {
  padding: 16px;
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.soul-card:hover {
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.07);
  border-color: #c9d8ea;
}

.soul-card-featured {
  border-color: #b8ceff;
  background: linear-gradient(160deg, #ffffff, #f1f6ff);
}

.soul-card-glyph,
.soul-icon-large,
.file-icon,
.success-icon,
.wallet-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Manrope', sans-serif;
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  color: #2b4a73;
  background: #f2f6fc;
  border: 1px solid #d5e0ef;
}

.soul-card h3 {
  margin: 0;
  font-size: 1.06rem;
}

.soul-card p {
  color: var(--text-soft);
  margin-bottom: 12px;
  font-size: 0.89rem;
  overflow-wrap: anywhere;
}

.soul-format-label {
  margin: 0 0 10px;
  font-size: 0.74rem;
  color: var(--text-muted);
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.02em;
}

.soul-card-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.soul-card-actions .btn {
  width: 100%;
}

.soul-source-link {
  display: inline-flex;
  align-items: center;
  margin-bottom: 12px;
  text-decoration: none;
  color: #2c63c8;
  font-family: 'Manrope', sans-serif;
  font-size: 0.72rem;
}

.soul-source-link:hover {
  color: #164aab;
}

.soul-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.soul-card-meta > div:last-child {
  text-align: right;
}

.soul-lineage {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.lineage-mini {
  color: var(--text-muted);
  font-size: 0.74rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}

.badge {
  width: fit-content;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-family: 'Manrope', sans-serif;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 8px;
}

.badge-organic {
  color: #1d8f59;
  background: #eaf7f0;
}

.badge-asset,
.badge-soul,
.badge-playbook,
.badge-policy,
.badge-prompt,
.badge-guide,
.badge-workflow,
.badge-knowledge {
  color: #1f5cae;
  background: #ebf2ff;
}

.badge-skill {
  color: #7b4db5;
  background: #f2eaff;
}

.badge-hybrid {
  color: #995d05;
  background: #fff5e7;
}

.badge-synthetic {
  color: #1f5cae;
  background: #ebf2ff;
}

.price {
  font-size: 1rem;
  font-weight: 800;
}

.currency {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 3px;
}

.btn {
  border-radius: 10px;
  border: 1px solid transparent;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: 'Manrope', sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  min-height: 40px;
  padding: 0 14px;
  transition: filter 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.btn:hover {
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  background: #246bff;
  color: #ffffff;
}

.btn-primary:hover {
  filter: brightness(1.03);
}

.btn-ghost {
  border-color: var(--line-strong);
  background: #f7fbff;
  color: var(--text-soft);
}

.btn-ghost:hover {
  border-color: #b9cfdf;
  color: var(--text);
}

.btn-lg {
  min-height: 46px;
  padding: 0 18px;
  font-size: 0.86rem;
}

.btn-full {
  width: 100%;
  min-height: 44px;
}

.btn:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  transform: none;
}

.agent-api-card {
  padding: 18px;
}

.agent-api-card h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.agent-api-card p {
  color: var(--text-soft);
  margin-bottom: 10px;
}

.agent-api-card code {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfe;
  color: #244b84;
  padding: 8px 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.74rem;
}

.hero-code-block {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  color: #1f3b5b;
  padding: 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.73rem;
  overflow: auto;
}

.agent-api-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.agent-quickstart {
  margin: 10px 0 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.agent-quickstart p {
  margin: 0;
}

.webmcp-contract-view {
  margin-top: 14px;
}

.webmcp-section {
  margin-top: 18px;
}

.webmcp-section h4 {
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.webmcp-kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.webmcp-kv-grid > div {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f9fbff;
  padding: 10px;
}

.webmcp-kv-grid strong {
  display: block;
  font-size: 0.77rem;
  margin-bottom: 4px;
  color: var(--text);
}

.webmcp-kv-grid span {
  display: block;
  color: var(--text-soft);
  font-size: 0.78rem;
  word-break: break-word;
}

.footer {
  border-top: 1px solid var(--line);
  padding: 22px 0;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.75rem;
  background: #fbfdff;
}

.footer a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
}

.footer a:hover {
  text-decoration: underline;
}

.admin-main,
.creator-main {
  padding: 26px 0 48px;
}

.admin-section,
.creator-section {
  padding: 0 0 14px;
}

.admin-header-card h1,
.creator-header-card h1 {
  font-size: clamp(1.28rem, 3.6vw, 1.9rem);
  margin-bottom: 8px;
}

.admin-token-row,
.creator-action-row,
.admin-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-input,
.creator-input,
.creator-textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  padding: 10px 12px;
  font-size: 0.82rem;
}

.admin-status,
.creator-status {
  color: var(--text-muted);
  font-size: 0.76rem;
}

.admin-actions,
.creator-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.admin-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.admin-list {
  display: grid;
  gap: 8px;
}

.admin-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #ffffff;
  padding: 11px;
}

.admin-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.admin-card h4 {
  font-size: 0.9rem;
}

.admin-line {
  color: var(--text-soft);
  font-size: 0.76rem;
  margin-bottom: 5px;
}

.admin-line code {
  color: var(--text);
}

.admin-empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  padding: 12px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.admin-empty a,
.admin-empty a:visited {
  color: #79b8ff;
  text-decoration: none;
  border-bottom: 1px solid rgba(121, 184, 255, 0.45);
  font-weight: 700;
}

.admin-empty a:hover {
  color: #a9d4ff;
  border-bottom-color: rgba(169, 212, 255, 0.8);
}

.creator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 12px;
}

.creator-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.creator-form-grid label,
.agent-api-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: 'Manrope', sans-serif;
  font-size: 0.68rem;
  color: var(--text-soft);
}

.creator-textarea {
  width: 100%;
  resize: vertical;
  margin-bottom: 10px;
}

.creator-output {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #f8fafc;
  color: #334155;
  min-height: 420px;
  overflow: auto;
  padding: 12px;
  font-family: 'Manrope', sans-serif;
  font-size: 0.74rem;
}

.creator-published-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.creator-action-row .btn,
.creator-published-actions .btn,
.admin-card-actions .btn {
  min-width: 108px;
}

.btn-danger {
  border-color: rgba(235, 87, 87, 0.42);
  color: #ffb5b5;
}

.btn-danger:hover {
  border-color: rgba(248, 81, 73, 0.72);
  color: #ffd3d3;
}

.admin-edit-modal-content {
  width: min(820px, 96vw);
  max-height: 92vh;
}

.admin-edit-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.admin-edit-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: 'Manrope', sans-serif;
  font-size: 0.68rem;
  color: var(--text-soft);
}

.admin-edit-markdown {
  grid-column: 1 / -1;
}

.admin-edit-markdown textarea {
  margin-bottom: 0;
}

.admin-edit-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.soul-detail {
  padding: 26px 0 44px;
}

.soul-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-bottom: 20px;
}

.soul-title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.soul-title-row .title-hash {
  font-size: clamp(1.7rem, 4.8vw, 2.9rem);
  line-height: 1.08;
}

.soul-icon-large {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  font-size: 1rem;
}

.soul-title {
  font-size: clamp(1.7rem, 4.8vw, 2.9rem);
  line-height: 1.08;
  margin-bottom: 0;
}

.soul-title-row + .soul-description {
  margin-top: 10px;
}

.soul-description {
  color: var(--text-soft);
  max-width: 760px;
  margin-bottom: 12px;
}

.lineage-text {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.soul-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-soft);
  padding: 4px 9px;
  font-family: 'Manrope', sans-serif;
  font-size: 0.68rem;
}

.soul-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
}

.soul-preview,
.purchase-card {
  padding: 18px;
}

.soul-preview h3 {
  margin-bottom: 10px;
}

.file-list {
  margin-bottom: 14px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbff;
}

.file-info {
  display: flex;
  flex-direction: column;
}

.file-name {
  font-family: 'Manrope', sans-serif;
  font-size: 0.78rem;
}

.file-desc {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.preview-section h4 {
  margin-bottom: 8px;
  color: var(--text-soft);
  font-size: 0.88rem;
}

.preview-quote {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f9fbff;
  padding: 14px;
  color: var(--text-soft);
  font-family: 'Manrope', sans-serif;
  font-size: 0.76rem;
}

.soul-purchase {
  position: sticky;
  top: 86px;
  height: fit-content;
}

.price-display {
  text-align: center;
  margin-bottom: 10px;
}

.price-display .price {
  font-size: 2rem;
}

.network-badge {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  margin-bottom: 12px;
  color: var(--text-soft);
  font-family: 'Manrope', sans-serif;
  font-size: 0.7rem;
}

.dot,
.dot-blue {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1d8f59;
}

.dot-blue {
  background: #2f7cff;
}

.purchase-note {
  color: var(--text-muted);
  text-align: center;
  font-size: 0.75rem;
  margin-top: 10px;
}

.success-card {
  border-color: #b7dfc8;
  background: #eff9f3;
}

.success-icon {
  margin-bottom: 10px;
}

.success-card h3 {
  margin-bottom: 6px;
}

.success-card p {
  color: var(--text-soft);
  margin-bottom: 12px;
  font-size: 0.82rem;
}

.tx-hash {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 0.74rem;
  word-break: break-all;
}

.tx-hash a {
  color: #1c5cc1;
  text-decoration: none;
}

.settlement-verification {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbff;
  padding: 10px 12px;
  text-align: left;
}

.settlement-verification p {
  margin: 6px 0 0;
  color: var(--text-soft);
  font-size: 0.75rem;
}

.settlement-verification-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.verification-pill {
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.65rem;
  font-family: 'Manrope', sans-serif;
  border: 1px solid transparent;
}

.verification-pill-ok {
  border-color: rgba(20, 120, 75, 0.25);
  background: rgba(20, 120, 75, 0.12);
  color: #0d6d45;
}

.verification-pill-warn {
  border-color: rgba(160, 98, 26, 0.3);
  background: rgba(160, 98, 26, 0.12);
  color: #8a5214;
}

.settlement-verification-ok {
  border-color: #b7dfc8;
  background: #f4fcf7;
}

.settlement-verification-warn {
  border-color: #e6d2b3;
  background: #fffaf3;
}

.settlement-verification-pending {
  border-color: #d5ddeb;
  background: #f6f9ff;
}

.verification-grid {
  margin: 8px 0 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 10px;
  align-items: baseline;
}

.verification-grid dt {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.verification-grid dd {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text);
  font-family: 'Manrope', sans-serif;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(14, 30, 46, 0.42);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  width: min(460px, 92vw);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}

.modal-header h3 {
  font-size: 0.95rem;
}

.modal-close {
  border: 0;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.3rem;
}

.modal-close:hover {
  background: #eef4fb;
  color: var(--text);
}

.modal-body {
  padding: 14px;
}

.wallet-options {
  display: grid;
  gap: 8px;
}

.wallet-option {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.wallet-option:hover {
  border-color: #bfd3e6;
  background: #f7fbff;
}

.wallet-info {
  display: flex;
  flex-direction: column;
}

.wallet-name {
  font-size: 0.83rem;
  font-weight: 700;
}

.wallet-desc {
  color: var(--text-muted);
  font-size: 0.74rem;
}

.toast-container {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: grid;
  gap: 8px;
  z-index: 1100;
}

.toast {
  min-width: 220px;
  max-width: 380px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text-soft);
  box-shadow: var(--shadow-sm);
  padding: 10px 12px;
  font-family: 'Manrope', sans-serif;
  font-size: 0.75rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  border-color: #b9deca;
}

.toast-warning {
  border-color: #ecd4af;
}

.toast-error {
  border-color: #edb6c0;
}

.toast-info {
  border-color: #bfd1e9;
}

@media (max-width: 980px) {
  .hero-metrics,
  .workflow-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .soul-content-grid {
    grid-template-columns: 1fr;
  }

  .soul-purchase {
    position: static;
  }
}

@media (max-width: 760px) {
  .container {
    padding: 0 14px;
  }

  .header-content {
    min-height: 64px;
    position: relative;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 150;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-elevated);
    box-shadow: var(--shadow-md);
    padding: 10px;
  }

  .nav.open {
    display: flex;
  }

  .nav-link {
    display: block;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fbff;
    padding: 10px 12px;
  }

  .wallet-btn {
    width: 100%;
    padding: 10px 12px;
  }

  .hero {
    padding-top: 24px;
  }

  .hero-shell {
    padding: 26px 20px;
    border-radius: 18px;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .hero-inventory {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-metrics,
  .workflow-grid,
  .creator-form-grid,
  .creator-grid,
  .souls-grid,
  .soul-card-actions {
    grid-template-columns: 1fr;
  }

  .listing-search {
    width: 100%;
    min-width: 0;
    margin-left: 0;
  }

  .admin-actions,
  .creator-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-filter-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-edit-form {
    grid-template-columns: 1fr;
  }

  .soul-hero {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .toast-container {
    right: 10px;
    left: 10px;
  }

  .toast {
    max-width: none;
  }
}

/* Markdown-native dark redesign */
:root {
  --bg: #0d1117;
  --bg-soft: #111827;
  --surface: #161b22;
  --surface-elevated: #1b2230;
  --text: #e6edf3;
  --text-soft: #b9c4d4;
  --text-muted: #8b9ab0;
  --line: #253041;
  --line-strong: #334155;
  --brand: #58a6ff;
  --brand-soft: #172d4d;
  --brand-ink: #89c4ff;
  --success: #3fb950;
  --warning: #d29922;
  --error: #f85149;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 18px 40px rgba(0, 0, 0, 0.28);
}

body {
  background:
    radial-gradient(1000px 500px at 10% -10%, rgba(88, 166, 255, 0.08), transparent 60%),
    radial-gradient(900px 440px at 120% -20%, rgba(63, 185, 80, 0.06), transparent 62%),
    var(--bg);
  color: var(--text);
}

.header {
  background: rgba(13, 17, 23, 0.92);
  border-bottom: 1px solid var(--line);
}

.logo-mark {
  color: #3b82f6;
}

.nav-link {
  color: var(--text-soft);
}

.nav-link:hover {
  color: var(--brand-ink);
}

.wallet-btn {
  border-color: #3a4a63;
  background: #111827;
  color: var(--text);
}

.wallet-btn:hover {
  border-color: #4f6382;
}

.wallet-btn.connected {
  background: rgba(63, 185, 80, 0.12);
  color: #9ee6aa;
  border-color: rgba(63, 185, 80, 0.45);
}

.hero-shell,
.workflow-card,
.soul-card,
.agent-api-card,
.soul-preview,
.purchase-card,
.admin-card,
.modal-content {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.hero-kicker {
  border-color: #345173;
  background: #132132;
  color: #9bc8ff;
}

.hero-subtitle,
.section-head p,
.workflow-card p,
.soul-card p,
.agent-api-card p,
.admin-line,
.creator-status,
.admin-status,
.soul-description,
.file-desc,
.preview-quote,
.purchase-note,
.lineage-text {
  color: var(--text-soft);
}

.hero-inventory {
  border-color: var(--line);
  background: #101725;
}

.hero-inventory-copy strong {
  color: var(--text);
}

.hero-inventory-copy span {
  color: var(--text-muted);
}

.hero-metrics div {
  background: #111827;
  border-color: var(--line);
}

.hero-metrics div:nth-child(1) strong {
  color: #58a6ff;
}

.hero-metrics div:nth-child(2) strong {
  color: #f2a272;
}

.hero-metrics div:nth-child(3) strong {
  color: #7ee787;
}

.hero-metrics div:nth-child(4) strong {
  color: #d2a8ff;
}

.hero-metrics div:nth-child(5) strong {
  color: #e3b341;
}

.hero-code-block {
  border-color: #344154;
  background: #0f141d;
  color: #d2deeb;
}

.agent-api-card code,
.webmcp-kv-grid > div {
  border-color: #32445d;
  background: #121b29;
  color: #9fc7ff;
}

.btn-ghost {
  border-color: #3b4b62;
  background: #111827;
  color: var(--text-soft);
}

.btn-ghost:hover {
  border-color: #526686;
  color: var(--text);
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #eaf3ff;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-danger {
  border-color: rgba(248, 81, 73, 0.45);
  color: #ffb4b0;
}

.btn-danger:hover {
  border-color: rgba(248, 81, 73, 0.8);
  color: #ffd3d0;
  background: rgba(248, 81, 73, 0.08);
}

.badge-organic {
  color: #9ee6aa;
  background: rgba(63, 185, 80, 0.12);
}

.badge-asset,
.badge-soul,
.badge-playbook,
.badge-policy,
.badge-prompt,
.badge-guide,
.badge-workflow,
.badge-knowledge,
.badge-synthetic {
  color: #9fc7ff;
  background: rgba(88, 166, 255, 0.12);
}

.badge-skill {
  color: #d2a8ff;
  background: rgba(210, 168, 255, 0.16);
}

.badge-hybrid {
  color: #f4c584;
  background: rgba(210, 153, 34, 0.14);
}

.lineage-mini,
.currency,
.soul-format-label {
  color: var(--text-muted);
}

.soul-source-link {
  color: #79b8ff;
}

.soul-source-link:hover {
  color: #a9d4ff;
}

.soul-card:hover {
  border-color: #3a4f6a;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.26);
}

.listing-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  align-items: center;
}

.filter-pill {
  border: 1px solid #3a4b64;
  background: #101726;
  color: var(--text-soft);
  border-radius: 999px;
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.filter-pill:hover {
  border-color: #587096;
  color: var(--text);
}

.filter-pill.active {
  border-color: #5b8fd4;
  background: #17345a;
  color: #cce4ff;
}

.filter-pill[data-asset-type='skill'].active,
.filter-pill[data-filter-type='skill'].active {
  border-color: #8260b8;
  background: #2a2140;
  color: #d2a8ff;
}

.listing-search {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 250px;
}

.listing-search-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.listing-search input {
  width: 100%;
  min-height: 34px;
  border: 1px solid #3a4b64;
  border-radius: 999px;
  background: #101726;
  color: var(--text);
  font-size: 0.78rem;
  padding: 0 12px;
  outline: none;
}

.listing-search input:focus {
  border-color: #5b8fd4;
  box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.14);
}

.soul-card-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.title-hash {
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1;
}

.hash-tone-blue {
  color: #58a6ff;
}

.hash-tone-orange {
  color: #f2a272;
}

.hash-tone-green {
  color: #7ee787;
}

.hash-tone-purple {
  color: #d2a8ff;
}

.hash-tone-yellow {
  color: #e3b341;
}

.admin-input,
.creator-input,
.creator-textarea {
  border-color: #344154;
  background: #0f141d;
  color: var(--text);
}

.creator-output,
.preview-quote,
.network-badge,
.settlement-verification,
.file-item {
  border-color: #2d3b50;
  background: #0f1722;
  color: var(--text-soft);
}

.network-badge {
  color: var(--text-soft);
}

.dot-blue {
  background: #58a6ff;
}

.dot {
  background: #3fb950;
}

.footer {
  border-top-color: var(--line);
  background: #0f141d;
  color: var(--text-muted);
}

.modal {
  background: rgba(2, 6, 12, 0.6);
}

.modal-header,
.modal-content {
  border-color: var(--line);
}

.wallet-option {
  border-color: #344154;
  background: #101726;
  color: var(--text);
}

.wallet-option:hover {
  border-color: #4a5f7f;
  background: #142033;
}

.wallet-desc {
  color: var(--text-muted);
}

.toast {
  background: #111827;
  color: var(--text-soft);
  border-color: #3b4b62;
}

.toast-success {
  border-color: rgba(63, 185, 80, 0.55);
}

.toast-warning {
  border-color: rgba(210, 153, 34, 0.55);
}

.toast-error {
  border-color: rgba(248, 81, 73, 0.6);
}

.toast-info {
  border-color: rgba(88, 166, 255, 0.55);
}

@media (max-width: 760px) {
  .nav {
    background: #0f141d;
    border-color: var(--line);
  }

  .nav-link {
    border-color: #2d3c50;
    background: #111827;
    color: var(--text-soft);
  }
}
