.commands-explorer {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 22px;
  padding: 42px 0 80px;
}

.command-sidebar,
.command-results {
  min-width: 0;
}

.command-sidebar {
  position: sticky;
  top: 110px;
  align-self: start;
  padding: 18px;
  background: var(--cream);
  border: 2px solid var(--line);
  box-shadow: 5px 5px 0 var(--orange);
}

.command-sidebar h1 {
  margin: 0 0 18px;
  font: 700 22px/1.1 'Pixelify Sans', sans-serif;
}

.category-list {
  display: grid;
  gap: 6px;
}

.category-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 9px;
  color: var(--ink);
  background: transparent;
  border: 2px solid transparent;
  cursor: pointer;
  font: 600 14px/1.2 'Space Grotesk', sans-serif;
  text-align: left;
}

.category-button:hover,
.category-button.active {
  color: #fff;
  background: var(--orange);
  border-color: var(--ink);
}

.category-count {
  min-width: 27px;
  padding: 3px 5px;
  color: var(--ink);
  background: var(--skin);
  border: 2px solid var(--ink);
  font: 700 11px/1 'DM Mono', monospace;
  text-align: center;
}

.command-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--white);
  border: 2px solid var(--line);
}

.command-search span { color: var(--orange); font-size: 20px; }
.command-search input {
  width: 100%;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font: 15px 'Space Grotesk', sans-serif;
}

.command-search input::placeholder { color: var(--muted); }

.command-results-list {
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 245px);
  overflow-y: auto;
  padding: 2px 8px 10px 2px;
  scrollbar-color: var(--orange) var(--cream);
  scrollbar-width: thin;
}

.explorer-card {
  overflow: hidden;
  background: var(--cream);
  border: 2px solid var(--line);
  box-shadow: 5px 5px 0 var(--brown);
}

.explorer-card[hidden] { display: none; }

.command-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 18px;
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
}

.command-letter {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #fff;
  background: var(--orange);
  border: 2px solid var(--ink);
  font: 700 16px/1 'Pixelify Sans', sans-serif;
}

.command-name {
  display: block;
  margin-bottom: 4px;
  font: 700 18px/1.1 'Pixelify Sans', sans-serif;
}

.command-summary {
  display: block;
  color: var(--muted);
  font: 14px/1.4 'Space Grotesk', sans-serif;
}

.command-arrow {
  color: var(--orange);
  font-size: 22px;
  transition: transform .2s steps(2, end);
}

.explorer-card.open .command-arrow { transform: rotate(90deg); }
.explorer-card[open] .command-arrow { transform: rotate(90deg); }

.command-row::-webkit-details-marker { display: none; }
.command-row { list-style: none; }

.command-detail {
  display: none;
  margin: 0 18px 18px 69px;
  padding: 13px;
  color: var(--muted);
  background: var(--white);
  border-left: 4px solid var(--orange);
  font: 13px/1.55 'Space Grotesk', sans-serif;
}

.explorer-card.open .command-detail { display: block; }

.command-detail h4 {
  margin: 0 0 10px;
  color: var(--ink);
  font: 700 14px/1 'Pixelify Sans', sans-serif;
}

.command-detail h4:not(:first-child) {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.command-detail p {
  margin: 0;
  color: var(--muted);
}

.command-detail code {
  display: block;
  padding: 10px;
  overflow-x: auto;
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 8%, var(--white));
  font: 13px/1.3 'DM Mono', monospace;
  white-space: pre-wrap;
}

.commands-empty {
  display: none;
  padding: 35px;
  color: var(--muted);
  background: var(--cream);
  border: 2px dashed var(--orange);
  text-align: center;
}

@media (max-width: 800px) {
  .commands-explorer {
    display: block;
    padding: 28px 0 58px;
  }

  .command-sidebar {
    position: static;
    margin-bottom: 18px;
  }

  .category-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 3px;
  }

  .category-button {
    min-width: max-content;
  }

  .command-row { padding: 15px 13px; }
  .command-name { font-size: 16px; }
  .command-summary { font-size: 13px; }
  .command-detail { margin-left: 57px; }

  .command-results-list {
    max-height: none;
    overflow: visible;
    padding: 0 2px 8px;
  }
}
