/* Self-contained search and agent discovery additions to the public docs. */
.docs-contents-toggle {
  display: none;
}

.docs-search[hidden],
.docs-search [hidden] {
  display: none !important;
}

.docs-search {
  margin: 28px 0;
  padding: 26px;
  border: 1px solid #ded5f5;
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 95% 0, #e7f6f0 0, transparent 48%),
    linear-gradient(125deg, #f4effe, #fdfcff 68%);
  box-shadow: 0 10px 35px #4e347109;
}

.docs-search-heading,
.agent-resources-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.docs-search-eyebrow {
  display: block;
  margin: 0 0 9px;
  color: #64507f;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.11em;
  line-height: 1.5;
}

main.api .docs-search h2,
main.api .agent-resources h2 {
  margin: 0;
  padding: 0;
  font-size: 23px;
  line-height: 1.3;
  letter-spacing: -0.035em;
}

.docs-search-local {
  flex-shrink: 0;
  padding: 5px 10px;
  border: 1px solid #d5e6e0;
  border-radius: 20px;
  color: #3d6356;
  background: #f3faf7;
  font-size: 11px;
  font-weight: 650;
}

.docs-search-form {
  margin-top: 22px;
}

.docs-search-form label {
  display: block;
  margin-bottom: 8px;
  color: #4f455f;
  font-size: 12px;
  font-weight: 650;
}

.docs-search-field {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px 7px 15px;
  background: #fff;
  border: 1px solid #cbbce8;
  border-radius: 12px;
  box-shadow: 0 2px 6px #45297906;
}

.docs-search-field:focus-within {
  outline: 3px solid #c7b6f0;
  outline-offset: 3px;
}

.docs-search-field svg {
  flex-shrink: 0;
  color: #7455ac;
}

.docs-search-field input {
  width: 100%;
  min-width: 0;
  padding: 9px 0;
  border: 0;
  background: transparent;
  color: #2c2536;
  font: inherit;
  font-size: 15px;
  outline: none;
  -webkit-appearance: none;
}

.docs-search-field input::placeholder {
  color: #787081;
  opacity: 1;
}

.docs-search-field input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.docs-search button {
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
}

.docs-search button:focus-visible,
.agent-resource-grid a:focus-visible {
  outline: 3px solid #7152be;
  outline-offset: 3px;
}

.docs-search-submit {
  flex-shrink: 0;
  min-height: 38px;
  padding: 7px 15px;
  border: 1px solid #6947b4;
  border-radius: 8px;
  background: #6947b4;
  color: #fff;
}

.docs-search-submit:hover {
  background: #523393;
}

.docs-search-clear {
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: #614c83;
}

main.api #docs-search-help {
  margin: 10px 0 13px;
  color: #686070;
  font-size: 12px;
}

.docs-search-suggestions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: #6a6079;
  font-size: 12px;
}

.docs-search-suggestions button {
  padding: 4px 9px;
  border: 1px solid #ded4f0;
  border-radius: 6px;
  background: #ffffffc9;
  color: #624a88;
  font-size: 11px;
  font-weight: 550;
}

.docs-search-suggestions button:hover {
  border-color: #9f88c8;
  background: #fff;
}

.docs-search-response {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e2d9f1;
}

main.api .docs-search-status {
  margin: 0;
  color: #61566e;
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.docs-search-results {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.docs-search-results:empty {
  display: none;
}

.docs-search-results a {
  display: grid;
  gap: 5px;
  padding: 16px 18px;
  border: 1px solid #e4dcef;
  border-radius: 12px;
  background: #fff;
  color: #2e253b;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.docs-search-results a:hover {
  border-color: #b49ad8;
  background: #fefcff;
}

.docs-search-results strong {
  font-size: 15px;
  line-height: 1.4;
}

.docs-result-kind {
  width: fit-content;
  color: #76529c;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.docs-result-excerpt {
  color: #665e6e;
  font-size: 13px;
  line-height: 1.55;
}

.docs-result-path {
  margin-top: 3px;
  color: #725a91;
  font:
    11px/1.5 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
}

.docs-search-retry {
  margin-top: 12px;
  padding: 8px 12px;
  border: 1px solid #cbbbe2;
  border-radius: 8px;
  background: #fff;
  color: #644786;
}

.agent-resources {
  margin: 34px 0 16px;
  padding: 25px;
  border: 1px solid #dedce7;
  border-radius: 20px;
  background: linear-gradient(135deg, #fff, #f4f2fa);
}

.agent-mcp-link {
  color: #6945a4;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.agent-mcp-link:hover {
  text-decoration: underline;
}

main.api .agent-resources > p {
  margin: 13px 0 18px;
  color: #645e6e;
  font-size: 14px;
}

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

.agent-resource-grid a {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border: 1px solid #e3ddec;
  border-radius: 13px;
  background: #fff;
  color: #645a70;
  font-size: 12px;
  line-height: 1.5;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.agent-resource-grid a:hover {
  border-color: #ae95d0;
  box-shadow: 0 4px 14px #4b316908;
}

.agent-resource-grid .agent-resource-type {
  color: #745694;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.agent-resource-grid strong {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #342c40;
  font-size: 15px;
}

.agent-resource-grid strong span {
  color: #806497;
}

.agent-resource-grid code {
  width: fit-content;
  padding: 2px 6px;
  border-radius: 5px;
  background: #f1ecf7;
  color: #6b508a;
  font-size: 11px;
}

main.api .agent-resources .agent-resources-note {
  margin: 16px 0 0;
  color: #716778;
  font-size: 12px;
}

@media (max-width: 900px) {
  .side.docs-contents-ready {
    padding: 0 0 15px;
    margin-bottom: 20px;
  }

  .docs-contents-ready .docs-contents-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 15px;
    border: 1px solid #ded5eb;
    border-radius: 11px;
    background: #fff;
    color: #534364;
    font: inherit;
    font-size: 13px;
    font-weight: 650;
    text-align: left;
    cursor: pointer;
  }

  .docs-contents-toggle:focus-visible {
    outline: 3px solid #7152be;
    outline-offset: 3px;
  }

  .docs-contents-toggle svg {
    flex-shrink: 0;
  }

  .docs-contents-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
  }

  .docs-contents-ready:not(.is-open) #docs-contents-nav {
    display: none;
  }

  .docs-contents-ready.is-open #docs-contents-nav {
    margin-top: 12px;
  }
}

@media (max-width: 600px) {
  .site-head .top {
    flex-wrap: wrap;
    gap: 14px;
    padding: 18px 0;
  }

  .site-head .top nav {
    width: 100%;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin-left: 0;
  }

  main.api .tabs {
    flex-wrap: wrap;
  }

  main.api p > code,
  main.api li > code,
  main.api .auth > code {
    overflow-wrap: anywhere;
    word-break: normal;
  }

  /* Long API paths must wrap inside their cells instead of widening the page. */
  main.api table {
    table-layout: fixed;
    width: 100%;
  }

  main.api th,
  main.api td,
  main.api td code {
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .docs-search,
  .agent-resources {
    padding: 18px;
    border-radius: 16px;
  }

  main.api .docs-search h2,
  main.api .agent-resources h2 {
    font-size: 21px;
  }

  .docs-search-field {
    flex-wrap: wrap;
    gap: 5px;
    padding: 7px 9px;
  }

  .docs-search-field svg {
    width: 19px;
  }

  .docs-search-field input {
    flex: 1;
    width: calc(100% - 35px);
    font-size: 16px;
  }

  .docs-search-clear {
    order: 3;
    margin-right: auto;
    min-height: 38px;
  }

  .docs-search-submit {
    order: 4;
    width: 100%;
  }

  .docs-search-clear:not([hidden]) + .docs-search-submit {
    width: auto;
  }

  .agent-resource-grid {
    grid-template-columns: 1fr;
  }

  .docs-search-results a {
    padding: 14px;
  }
}
