:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f6f4;
  color: #151817;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

#app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
}

.sidebar {
  background: #0f1412;
  color: #f8fbf8;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 4px 12px;
}

.brand-mark,
.tool-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #d9ff5f;
  color: #0f1412;
  font-weight: 850;
}

.brand strong {
  display: block;
  font-size: 16px;
}

.brand span,
.sidebar-label,
.wallet-panel span,
.eyebrow,
.subhead,
.catalog-head span,
.tool-card p,
.tool-meta,
.protocol-row,
.detail-category,
.detail-grid span,
.endpoint-card span,
.receipt-preview span,
.quote-strip span {
  color: #6f7975;
  font-size: 13px;
}

.primary-nav,
.category-list {
  display: grid;
  gap: 7px;
}

.primary-nav__item,
.category {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d9dfdc;
  text-decoration: none;
  padding: 10px 11px;
  text-align: left;
}

.primary-nav__item.active,
.primary-nav__item:hover,
.category.active,
.category:hover {
  background: #1b2420;
  color: #ffffff;
}

.sidebar-section {
  display: grid;
  gap: 10px;
}

.sidebar-label {
  padding: 0 8px;
  text-transform: uppercase;
  font-weight: 750;
}

.category {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.wallet-panel {
  margin-top: auto;
  display: grid;
  gap: 10px;
  border: 1px solid #27322e;
  border-radius: 8px;
  padding: 14px;
  background: #141b18;
}

.wallet-panel strong {
  font-size: 30px;
}

.wallet-panel button,
.actions button {
  border: 0;
  border-radius: 8px;
  background: #d9ff5f;
  color: #0f1412;
  font-weight: 800;
  padding: 11px 12px;
}

.main {
  min-width: 0;
  padding: 26px;
  display: grid;
  gap: 18px;
}

.topbar,
.stats,
.market-layout {
  max-width: 1320px;
  width: 100%;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  margin: 0 0 8px;
  font-size: 32px;
  line-height: 1.08;
}

.subhead {
  display: block;
  max-width: 620px;
  color: #53605b;
}

.search-box {
  min-width: 340px;
}

.search-box input,
label input,
label textarea {
  width: 100%;
  border: 1px solid #d7dedb;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px 13px;
  outline: none;
}

.search-box input:focus,
label input:focus,
label textarea:focus {
  border-color: #97b832;
  box-shadow: 0 0 0 3px rgba(217, 255, 95, 0.28);
}

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

.stats div,
.catalog-shell,
.detail-panel {
  background: #ffffff;
  border: 1px solid #dfe5e2;
  border-radius: 8px;
}

.stats div {
  padding: 13px;
  display: grid;
  gap: 5px;
}

.stats strong {
  font-size: 15px;
}

.market-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 14px;
  align-items: start;
}

.catalog-shell {
  padding: 14px;
}

.catalog-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 11px;
}

.tool-card {
  min-height: 212px;
  border: 1px solid #e0e5e2;
  border-radius: 8px;
  background: #fbfcfb;
  padding: 15px;
  text-align: left;
  display: grid;
  gap: 12px;
  align-content: space-between;
}

.tool-card.active,
.tool-card:hover {
  border-color: #8faf2d;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(20, 28, 24, 0.08);
}

.tool-card__top,
.tool-meta,
.protocol-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.tool-card h3 {
  margin: 0 0 7px;
  font-size: 18px;
}

.tool-card p {
  margin: 0;
  min-height: 40px;
  line-height: 1.45;
}

.status {
  border-radius: 999px;
  padding: 4px 8px;
  background: #edf1ef;
  color: #53605b;
}

.status.ok {
  background: #edf9cf;
  color: #465d00;
}

.status.warn {
  background: #fff2cf;
  color: #725300;
}

.detail-panel {
  position: sticky;
  top: 18px;
  padding: 0;
  overflow: hidden;
}

.detail-hero {
  padding: 18px 18px 16px;
  background: #f9fbf6;
  border-bottom: 1px solid #dfe5e2;
}

.detail-hero h2 {
  margin: 8px 0 8px;
  font-size: 28px;
  line-height: 1.08;
}

.detail-hero p,
.detail-copy p {
  margin: 0;
  color: #53605b;
  line-height: 1.5;
}

.detail-category {
  text-transform: uppercase;
  font-weight: 800;
}

.tab-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid #dfe5e2;
}

.tab-row button {
  border: 0;
  background: #ffffff;
  padding: 12px 8px;
  color: #53605b;
  font-weight: 750;
}

.tab-row button.active {
  color: #151817;
  box-shadow: inset 0 -3px 0 #d9ff5f;
}

.tab-panel {
  padding: 16px;
  display: grid;
  gap: 15px;
}

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

.detail-grid div,
.endpoint-card,
.quote-strip div {
  border: 1px solid #e3e8e5;
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 6px;
  background: #fbfcfb;
}

.detail-grid strong,
.quote-strip strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.detail-list h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.detail-list ul {
  margin: 0;
  padding-left: 18px;
  color: #34403b;
  line-height: 1.55;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.pill-row span {
  border-radius: 999px;
  border: 1px solid #dfe5e2;
  padding: 6px 9px;
  background: #fbfcfb;
  color: #34403b;
  font-size: 13px;
}

.try-panel {
  display: grid;
  gap: 12px;
}

label {
  color: #53605b;
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

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

.endpoint-card code {
  color: #151817;
  overflow-wrap: anywhere;
}

.code-block,
.receipt-preview pre {
  margin: 0;
  border-radius: 8px;
  background: #111713;
  color: #e8f8c7;
  padding: 12px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.5;
}

.receipt-preview {
  display: grid;
  gap: 8px;
}

.error,
.detail-panel.empty {
  padding: 24px;
}

@media (max-width: 1120px) {
  .market-layout {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
  }
}

@media (max-width: 860px) {
  #app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box {
    min-width: 0;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .main {
    padding: 16px;
  }

  .stats,
  .detail-grid,
  .quote-strip {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 27px;
  }
}
