/* Orbistocks /agents (owner: agents): a doc layout with a sticky side index, live endpoint cards and the analyst panel. */

.agents { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; align-items: start; }
.agents__aside { position: sticky; top: calc(var(--nav-h) + 24px); max-height: calc(100vh - var(--nav-h) - 48px); overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding-right: 8px; }
.agents__aside a { display: flex; align-items: center; min-height: 40px; padding: 0 10px; border-radius: 8px; font: 400 14px/1.3 var(--font-sans); color: var(--muted); border-left: 2px solid transparent; transition: color var(--dur) var(--ease), background var(--dur) var(--ease); }
.agents__aside a:hover { color: var(--text); background: rgba(255, 255, 255, 0.03); }
.agents__aside a.is-active { color: var(--text); border-left-color: var(--green); border-radius: 0 8px 8px 0; }
.agents__aside .t-mono { padding: 0 10px 8px; }
.agents__body { min-width: 0; }
@media (max-width: 1023px) {
  .agents { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .agents__aside { position: sticky; top: var(--nav-h); z-index: 5; max-height: none; flex-direction: row; gap: 6px; overflow-x: auto; padding: 10px 0; margin: 0 calc(-1 * var(--gutter)); padding-inline: var(--gutter); background: rgba(15, 17, 19, 0.92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .agents__aside::-webkit-scrollbar { display: none; }
  .agents__aside .t-mono { display: none; }
  .agents__aside a { flex: none; min-height: 40px; border: 1px solid var(--line-2); border-radius: var(--radius-pill); padding: 0 14px; font-size: 13px; }
  .agents__aside a.is-active { border-color: var(--green); color: var(--text); border-radius: var(--radius-pill); background: var(--green-soft); }
}

/* prose */
.agents-prose { color: var(--text-2); font-size: var(--fs-body); line-height: 1.65; }
.agents-prose > * + * { margin-top: 16px; }
.agents-prose h1 { margin-bottom: 8px; }
.agents-prose h2 { font: 500 clamp(24px, 2.4vw, 32px)/1.2 var(--font-sans); letter-spacing: -0.015em; color: var(--text); margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--nav-h) + 24px); }
.agents-prose h2:first-of-type { margin-top: 24px; }
.agents-prose h3 { font: 500 18px/1.3 var(--font-sans); color: var(--text); margin-top: 36px; scroll-margin-top: calc(var(--nav-h) + 72px); }
.agents-prose p { color: var(--text-2); }
.agents-prose ul { padding-left: 22px; display: flex; flex-direction: column; gap: 8px; list-style: disc; }
.agents-prose li::marker { color: var(--dim); }
.agents-prose strong { color: var(--text); font-weight: 500; }
.agents-prose code { white-space: nowrap; }
.agents-prose pre code { white-space: pre; }
.agents-prose .t-small { color: var(--muted); }
.agents-prose p a, .agents-prose li a { display: inline-block; padding-block: 10px; margin-block: -10px; }
.agents-prose .kv-list { display: flex; flex-direction: column; padding: 4px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.agents-prose .kv-list .kv { padding: 10px 0; border-bottom: 1px solid var(--line); min-height: 44px; align-items: center; }
.agents-prose .kv-list .kv:last-child { border-bottom: 0; }
.agents-prose .kv dd { text-align: right; overflow-wrap: anywhere; font-weight: 400; }
.agents__hero { padding-bottom: 24px; }
.agents__hero .eyebrow { display: flex; margin-bottom: 14px; }
.agents__hero .t-lead { margin-top: 16px; max-width: 58ch; }
.agents__links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 24px; }
.agents__status { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.agents__status .chip { height: auto; min-height: 32px; white-space: normal; }
.agents__status .dot { width: 6px; height: 6px; }
@media (max-width: 767px) { .agents-prose h2 { margin-top: 40px; padding-top: 20px; } .agents__links .pill { flex: 1 1 100%; } }

/* endpoint cards: the curl line, the JSON that scrolls inside itself, the foot */
.ep { margin-top: 16px; }
.ep:hover { transform: none; }
.ep__curl { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.015); min-width: 0; }
.ep__curl code { flex: 1 1 auto; min-width: 0; overflow-x: auto; white-space: nowrap; background: none; border: 0; padding: 6px 0; font-size: 12.5px; color: var(--text-2); scrollbar-width: thin; }
.ep__copy { flex: none; height: 40px; padding: 0 14px; font-size: 13px; }
.ep__code { margin: 0; border: 0; border-radius: 0; background: var(--bg); max-height: 360px; overflow: auto; padding: 14px 16px; font-size: 12.5px; line-height: 1.55; overscroll-behavior: contain; }
.ep__code.is-open { max-height: 70vh; }
.ep__code code { white-space: pre; display: block; min-width: max-content; }
.ep__code .j-k { color: var(--muted); }
.ep__code .j-s { color: var(--green-2); }
.ep__code .j-n { color: var(--text); }
.ep__code .j-b { color: var(--warn); }
.ep__code .j-x { color: var(--dim); }
.ep__code.is-error code { color: var(--down); white-space: pre-wrap; min-width: 0; }
.ep .device__foot { gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.ep .device__note { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.ep__more { height: 40px; padding: 0 14px; font-size: 13px; }
.ep__pick { margin-top: 16px; max-width: 260px; }
.ep__pick .field__box select, .analyst .field__box select { font: 500 15px/1.3 var(--font-sans); color: var(--text); padding-right: 24px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 11px) 55%, calc(100% - 6px) 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.ep__pick .field__box select option, .analyst .field__box select option { background: var(--panel); color: var(--text); }

/* the analyst */
.analyst { margin-top: 20px; display: flex; flex-direction: column; gap: 16px; }
.analyst__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.analyst__key { grid-column: 1; }
.analyst__keyactions { grid-column: 2; display: flex; gap: 8px; flex-wrap: wrap; align-self: start; padding-top: 22px; }
.analyst__keyactions .pill { flex: 1 1 120px; height: 48px; }
.analyst__q { grid-column: 1 / -1; }
.analyst__qbox { align-items: stretch; padding-block: 0; }
.analyst__qbox textarea { resize: vertical; min-height: 86px; font: 400 15px/1.5 var(--font-sans); padding: 12px 0; }
.analyst__actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.analyst__actions .pill { min-width: 180px; }
.analyst__actions .t-small { flex: 1 1 220px; min-width: 0; }
.analyst__out { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.analyst__out .pill { height: 40px; padding: 0 14px; font-size: 13px; }
.analyst__answer { display: flex; flex-direction: column; gap: 12px; font-size: 15px; line-height: 1.6; color: var(--text); max-height: 60vh; overflow-y: auto; overscroll-behavior: contain; }
.analyst__answer p { color: var(--text); overflow-wrap: anywhere; }
.analyst__answer .is-waiting { color: var(--muted); }
.analyst__answer .is-waiting::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-radius: 50%; background: var(--green); animation: dot-pulse 1.2s ease-in-out infinite; vertical-align: middle; }
.analyst__error span { overflow-wrap: anywhere; }
.analyst .field__hint { overflow-wrap: anywhere; }
.analyst .t-mono { overflow-wrap: anywhere; }
@media (max-width: 639px) {
  .analyst { padding: 16px; }
  .analyst__grid { grid-template-columns: minmax(0, 1fr); }
  .analyst__key, .analyst__keyactions { grid-column: 1; }
  .analyst__keyactions { padding-top: 0; }
  .analyst__actions .pill { width: 100%; }
}

/* phones: the card bar wraps so the title and the mono meta never share a line */
@media (max-width: 639px) {
  .ep .device__bar { height: auto; min-height: 44px; flex-wrap: wrap; gap: 2px 12px; padding: 10px 16px; }
  .ep .device__title { flex: 1 1 100%; white-space: normal; overflow: visible; overflow-wrap: anywhere; line-height: 1.3; }
  .ep .device__meta { flex: 1 1 100%; max-width: 100%; white-space: normal; overflow: visible; line-height: 1.4; }
}

.agents-prose a { overflow-wrap: anywhere; }
/* links inside running prose keep the text line: the 40px tap padding is for buttons and standalone links */
.agents-prose p a, .agents-prose li a { display: inline; padding: 0; min-height: 0; line-height: inherit; }
