.ref-shell {
  background: var(--cream);
}

.ref-layout {
  display: grid;
  grid-template-columns: minmax(15rem, 19rem) minmax(0, 1fr);
  max-width: 72rem;
  margin: 0 auto;
  min-height: calc(100vh - 3.5rem);
}

.ref-sidebar {
  position: sticky;
  top: 3.5rem;
  align-self: start;
  max-height: calc(100vh - 3.5rem);
  overflow: auto;
  padding: 1rem 0.85rem 2rem 1rem;
  border-right: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.875rem;
}

.search-wrap {
  display: block;
  margin: 0 0 1rem;
}

.search-wrap input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--cream);
  font: inherit;
  color: var(--ink);
}

.search-wrap input:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sidebar-label {
  margin: 0.85rem 0 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-overview {
  display: block;
  padding: 0.4rem 0.5rem;
  border-radius: 0.3rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.nav-overview:hover {
  background: var(--cream);
  color: var(--ink);
}

.nav-group {
  margin-bottom: 0.85rem;
}

.nav-group-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.3rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
}

.nav-group-overview:hover {
  background: var(--cream);
  color: var(--ink);
}

.nav-count {
  font-weight: 500;
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
}

.nav-group ul {
  list-style: none;
  margin: 0.15rem 0 0;
  padding: 0;
}

.nav-group li {
  margin: 0;
}

.nav-group a {
  display: flex;
  gap: 0.4rem;
  align-items: baseline;
  padding: 0.28rem 0.35rem 0.28rem 0.5rem;
  border-radius: 0.3rem;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.35;
}

.nav-group a:hover {
  background: var(--cream);
  color: var(--ink);
}

.nav-group a .method {
  flex: 0 0 auto;
  width: 3.1rem;
  font-size: 0.65rem;
}

.nav-group a span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.78rem;
}

.search-empty {
  margin: 1rem 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.ref-main {
  padding: 1.5rem 1.75rem 4rem;
  max-width: 54rem;
}

.ref-intro {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  scroll-margin-top: 4.5rem;
}

.index-heading {
  margin: 1.75rem 0 1rem;
  font-size: 1.1rem;
}

.index-group {
  margin: 0 0 1.5rem;
}

.index-group h2 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}

.index-group h2 a {
  color: var(--ink);
  text-decoration: none;
}

.index-group h2 a:hover {
  color: var(--accent);
}

.op-index {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.op-index-row {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr) auto;
  gap: 0.35rem 0.75rem;
  align-items: start;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  text-decoration: none;
  color: inherit;
  background: var(--cream);
}

.op-index-row:hover {
  border-color: #b8c4e0;
  color: inherit;
}

.op-index-main {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.op-index-row .op-path {
  font-size: 0.9rem;
  background: transparent;
  padding: 0;
}

.op-index-title {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
}

.op-index-row .pill-scope {
  margin-top: 0.15rem;
  justify-self: end;
}

.resource {
  margin-bottom: 2.5rem;
  scroll-margin-top: 4.5rem;
}

.resource-overview {
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.resource-title {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.op {
  margin: 0 0 2.25rem;
  padding: 1.25rem 0 0;
  scroll-margin-top: 4.5rem;
}

.op-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  margin-bottom: 0.5rem;
}

.op-path {
  font-size: 0.95rem;
  background: transparent;
  padding: 0;
}

.op h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.op h3 {
  margin: 1.25rem 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.method {
  display: inline-block;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  background: #e8edf5;
  color: #334155;
  text-align: center;
}

.method-get {
  background: #e5f3ec;
  color: #0f6b3d;
}

.method-post {
  background: #e8eefc;
  color: #1d4ed8;
}

.method-patch {
  background: #f3ebe0;
  color: #9a5b00;
}

.method-put {
  background: #f3ebe0;
  color: #9a5b00;
}

.method-delete {
  background: #fce8e8;
  color: #b42318;
}

.pill {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: var(--code-bg);
  color: var(--muted);
}

.pill-req {
  background: #fce8e8;
  color: #b42318;
}

.pill-scope {
  background: #e8eefc;
  color: #1d4ed8;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
}

.ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.ref-table th,
.ref-table td {
  text-align: left;
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.ref-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}

.resp-list {
  margin: 0;
  padding-left: 1.1rem;
}

.resp-list li {
  margin: 0.5rem 0;
}

.resp-list pre {
  margin-top: 0.5rem;
}

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

  .ref-sidebar {
    position: relative;
    top: 0;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .op-index-row {
    grid-template-columns: 3.4rem minmax(0, 1fr);
  }
}
