/* ===== Agents page styles — extends styles.css + docs.css ===== */

/* ===== Hero ===== */
.ag-hero {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--line);
}
.ag-lede-code {
  font-family: var(--mono); font-size: 0.86em;
  padding: 1px 6px; border-radius: 4px;
  background: var(--bg-2); border: 1px solid var(--line);
  color: var(--ink);
}
.ag-hero .ag-lede strong { color: var(--ink); font-weight: 500; }

/* ===== The call (canonical API request) ===== */
.ag-call-section { background: var(--bg-2); }
.call-card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--ink);
  color: var(--bg);
  overflow: hidden;
  margin-bottom: 24px;
}
.call-card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: color-mix(in oklch, var(--ink) 92%, white);
  border-bottom: 1px solid color-mix(in oklch, var(--ink) 80%, white);
  font-family: var(--mono); font-size: 12px;
}
.call-method {
  font-weight: 600; letter-spacing: 0.06em;
  padding: 3px 8px; border-radius: 4px;
  background: var(--accent); color: var(--accent-ink);
}
.call-path {
  color: var(--bg);
  word-break: break-all;
}
.call-spacer { flex: 1; }
.call-card .cb-copy {
  font-family: var(--mono); font-size: 11px;
  padding: 4px 10px; border-radius: 4px;
  background: transparent;
  color: var(--bg);
  border: 1px solid color-mix(in oklch, var(--bg) 35%, transparent);
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.call-card .cb-copy:hover {
  background: color-mix(in oklch, var(--bg) 12%, transparent);
  border-color: color-mix(in oklch, var(--bg) 55%, transparent);
}
.call-card .cb-copy.copied {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
}
.call-pre {
  margin: 0; padding: 18px 18px 20px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6;
  color: var(--bg);
  overflow-x: auto;
  white-space: pre;
}
.call-pre .t-str { color: oklch(0.85 0.10 145); }
.call-pre .t-com { color: oklch(0.65 0.02 250); font-style: italic; }

/* Key/value summary under the call */
.call-keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.call-key {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  padding: 16px 16px 14px;
  display: flex; flex-direction: column;
  min-width: 0;
}
.call-key-name {
  font-family: var(--mono); font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 8px;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.call-key-name code {
  font-family: var(--mono); font-size: 12px;
  color: var(--ink);
  background: var(--bg-2); border: 1px solid var(--line);
  padding: 1px 6px; border-radius: 4px;
  text-transform: none; letter-spacing: 0;
}
.call-key-or {
  font-family: var(--mono); font-size: 10px;
  color: var(--ink-3); letter-spacing: 0.04em;
}
.call-key-body {
  font-size: 13.5px; color: var(--ink-2); line-height: 1.55;
  text-wrap: pretty;
}
.call-key-body code {
  font-family: var(--mono); font-size: 12px;
  padding: 1px 5px; border-radius: 3px;
  background: var(--bg-2); border: 1px solid var(--line);
  color: var(--ink);
}
.call-key-body em { font-style: normal; color: var(--ink); font-weight: 500; }

@media (max-width: 880px) {
  .call-keys { grid-template-columns: 1fr; }
  .call-card-head { flex-wrap: wrap; }
}

/* ===== Callout (used in panels) ===== */
.callout {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-2);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px; align-items: start;
}
.callout-warn {
  background: color-mix(in oklch, var(--accent-soft) 60%, var(--bg));
  border-color: var(--accent-line);
}
.callout-tag {
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 4px;
  background: var(--accent); color: var(--accent-ink);
  white-space: nowrap;
}
.callout p {
  margin: 0; font-size: 14px; line-height: 1.55;
  color: var(--ink-2);
  text-wrap: pretty;
}
.callout p code {
  font-family: var(--mono); font-size: 12.5px;
  padding: 1px 5px; border-radius: 3px;
  background: var(--bg); border: 1px solid var(--line);
  color: var(--ink);
}
.ag-hero h1 {
  font-family: var(--display);
  font-size: clamp(40px, 5.6vw, 68px);
  letter-spacing: -0.03em; line-height: 1.0;
  margin: 16px 0 0; font-weight: 500;
  text-wrap: balance;
}
.ag-hero .ag-lede {
  margin-top: 22px; max-width: 640px;
  font-size: 18px; color: var(--ink-2); line-height: 1.55;
  text-wrap: pretty;
}

/* Agent pills row */
.ag-agent-row {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 32px;
}
.agent-pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px 8px 8px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--bg);
  font-size: 14px; color: var(--ink);
  transition: border-color .12s, background .12s, transform .12s;
}
.agent-pill:hover { border-color: var(--accent-line); background: var(--bg-2); transform: translateY(-1px); }
.agent-pill-stub { color: var(--ink-2); }
.ap-mark {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 12px; font-weight: 600;
}
.ap-mark.cl { background: oklch(0.94 0.05 30);  color: oklch(0.40 0.13 30); }
.ap-mark.cc { background: var(--ink); color: var(--bg); }
.ap-mark.cx { background: oklch(0.94 0.04 145); color: oklch(0.34 0.12 145); }
.ap-mark.cu { background: oklch(0.93 0.05 230); color: oklch(0.36 0.13 230); }
.ap-mark.dy { background: var(--bg-3); color: var(--ink-2); }
[data-theme="dark"] .ap-mark.cl { background: oklch(0.30 0.08 30); color: oklch(0.85 0.12 30); }
[data-theme="dark"] .ap-mark.cx { background: oklch(0.30 0.06 145); color: oklch(0.85 0.10 145); }
[data-theme="dark"] .ap-mark.cu { background: oklch(0.30 0.06 230); color: oklch(0.85 0.10 230); }

.ap-tag {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.05em;
  padding: 1px 6px; border-radius: 999px;
  background: var(--bg-3); color: var(--ink-3);
  text-transform: uppercase;
  margin-left: 4px;
}

/* ===== Sections ===== */
.ag-section { padding: 88px 0; border-top: 1px solid var(--line); }
.ag-section-head { display: flex; flex-direction: column; gap: 12px; max-width: 720px; margin-bottom: 48px; }
.ag-section-head h2 {
  font-family: var(--display);
  font-size: clamp(28px, 3.6vw, 40px);
  letter-spacing: -0.022em; line-height: 1.05;
  margin: 0; font-weight: 500;
  text-wrap: balance;
}
.ag-section-head p {
  margin: 0; color: var(--ink-2); font-size: 16.5px; max-width: 580px;
  text-wrap: pretty;
}

/* ===== Flow strip ===== */
.flow-strip {
  display: grid;
  grid-template-columns: 1fr auto 1.2fr auto 1fr;
  gap: 16px; align-items: stretch;
  margin-top: 8px;
}
.flow-node {
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--bg);
  padding: 18px 18px 16px;
  display: flex; flex-direction: column;
  min-width: 0;
}
.flow-node-mid {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}
.fn-num {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
  color: var(--ink-3); text-transform: uppercase; margin-bottom: 8px;
}
.flow-node-mid .fn-num { color: var(--accent-ink); }
.fn-title { font-family: var(--display); font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
.fn-sub { font-size: 13.5px; color: var(--ink-2); margin-top: 6px; line-height: 1.5; }
.fn-sub code {
  font-family: var(--mono); font-size: 11.5px;
  padding: 1px 5px; border-radius: 3px;
  background: var(--bg-2); border: 1px solid var(--line);
  color: var(--ink);
}
.fn-icon {
  margin-top: 14px; padding: 10px 12px;
  border-radius: 6px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px;
  color: var(--ink-2);
  overflow: hidden;
}
.fn-icon pre { margin: 0; white-space: pre; font-family: inherit; font-size: 11px; line-height: 1.5; }
.fn-icon-engine {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg);
  border-color: var(--accent-line);
  color: var(--accent-ink);
}
[data-theme="dark"] .fn-icon-engine { color: var(--accent); }
.engine-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 color-mix(in oklch, var(--accent) 60%, transparent); animation: pulse 1.6s infinite; }
.fn-icon-paste {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--ink); color: var(--bg);
  border-color: var(--ink);
  padding: 10px 14px;
}
.paste-pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in oklch, var(--accent) 70%, transparent);
  animation: pulse 1.6s infinite;
}
.flow-arrow { display: grid; place-items: center; color: var(--ink-3); }

@media (max-width: 980px) {
  .flow-strip { grid-template-columns: 1fr; gap: 8px; }
  .flow-arrow { transform: rotate(90deg); padding: 6px 0; }
}

/* ===== Agent tabs ===== */
.agent-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 32px;
}
.agent-tab {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  text-align: left;
  transition: border-color .12s, background .12s, transform .12s;
  min-width: 0;
}
.agent-tab:hover { border-color: var(--line-2); background: var(--bg-2); }
.agent-tab.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.agent-tab .ap-mark { width: 30px; height: 30px; flex: 0 0 30px; }
.at-name { font-family: var(--display); font-size: 15px; font-weight: 500; letter-spacing: -0.01em; color: var(--ink); display: block; }
.at-meta { font-family: var(--mono); font-size: 11px; color: var(--ink-3); display: block; margin-top: 2px; }
.agent-tab.active .at-meta { color: var(--accent-ink); }
[data-theme="dark"] .agent-tab.active .at-meta { color: var(--accent); }
.agent-tab > div { min-width: 0; }
.agent-tab .at-stack { display: flex; flex-direction: column; min-width: 0; }

/* ===== Agent panel ===== */
.agent-panel { display: none; }
.agent-panel.active { display: block; }

.ap-head {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px; align-items: start;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 36px;
}
.ap-tagline {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
  color: var(--accent-ink); text-transform: uppercase;
  margin-bottom: 8px;
}
[data-theme="dark"] .ap-tagline { color: var(--accent); }
.ap-head h3 {
  font-family: var(--display);
  font-size: 34px; letter-spacing: -0.022em; line-height: 1.05;
  margin: 0 0 14px; font-weight: 500;
}
.ap-head p { margin: 0; color: var(--ink-2); font-size: 16px; line-height: 1.55; max-width: 520px; }
.ap-head p strong { color: var(--ink); font-weight: 500; }
.ap-head p code {
  font-family: var(--mono); font-size: 0.86em;
  padding: 1px 6px; border-radius: 4px;
  background: var(--bg-2); border: 1px solid var(--line);
  color: var(--ink);
}

.ap-meta-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg);
}
.ap-meta-grid > div {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  font-size: 13px;
}
.ap-meta-grid > div:nth-child(1),
.ap-meta-grid > div:nth-child(2) { border-top: 0; }
.ap-meta-grid > div:nth-child(odd) { border-left: 0; }
.ap-meta-grid span {
  display: block;
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 3px;
}
.ap-meta-grid b { font-weight: 500; color: var(--ink); }

/* Steps */
.ap-steps { list-style: none; padding: 0; margin: 0; counter-reset: ap-step; }
.ap-steps > li { padding: 24px 0; border-top: 1px solid var(--line); }
.ap-steps > li:first-child { border-top: 0; padding-top: 0; }
.ap-step-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.ap-step-num {
  font-family: var(--mono); font-size: 11px;
  padding: 3px 8px; border-radius: 4px;
  background: var(--accent-soft); color: var(--accent-ink);
  letter-spacing: 0.04em;
}
.ap-step-head h4 {
  font-family: var(--display); font-size: 19px; letter-spacing: -0.012em;
  margin: 0; font-weight: 500;
}
.ap-step-head h4 code {
  font-family: var(--mono); font-size: 0.86em;
  padding: 1px 6px; border-radius: 4px;
  background: var(--bg-2); border: 1px solid var(--line);
  color: var(--ink);
}
.ap-steps p {
  margin: 8px 0 14px; max-width: 720px;
  color: var(--ink-2); font-size: 15px; line-height: 1.6;
  text-wrap: pretty;
}
.ap-steps p code, .prompt-list code {
  font-family: var(--mono); font-size: 0.86em;
  padding: 1px 6px; border-radius: 4px;
  background: var(--bg-2); border: 1px solid var(--line);
  color: var(--ink);
}

/* Prompt list */
.prompt-list {
  list-style: none; padding: 0; margin: 6px 0 0;
  display: grid; gap: 6px;
}
.prompt-list li {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-2);
  font-size: 14px;
  color: var(--ink);
}
.prompt-list code {
  background: transparent; border: 0; padding: 0;
  font-size: 13.5px; color: var(--ink-2);
}

/* Mock screenshot of skills panel */
.ap-shot {
  margin: 10px 0 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  padding: 14px;
}
.ap-shot-frame {
  border: 1px solid var(--line-2);
  border-radius: 8px; overflow: hidden;
}
.ap-shot-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-3);
}
.ap-shot-bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.ap-shot-bar span { margin-left: 8px; }
.ap-shot-body { padding: 10px; display: grid; gap: 6px; }
.ap-shot-row {
  display: grid; grid-template-columns: 28px 1fr auto;
  align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 6px;
  background: var(--bg-2);
}
.ap-shot-row.dim { background: transparent; opacity: 0.55; }
.ap-shot-ic {
  width: 24px; height: 24px; border-radius: 5px;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 12px;
}
.ap-shot-row.dim .ap-shot-ic { background: var(--bg-3); color: var(--ink-3); }
.ap-shot-row > div { min-width: 0; }
.ap-shot-row b { display: block; font-family: var(--display); font-size: 13.5px; font-weight: 500; color: var(--ink); letter-spacing: -0.005em; }
.ap-shot-row i { font-style: normal; display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.ap-shot-pill {
  font-family: var(--mono); font-size: 10.5px;
  padding: 3px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink);
  letter-spacing: 0.04em; text-transform: uppercase;
}
.ap-shot-pill-mute { background: var(--bg-3); color: var(--ink-3); }

/* ===== DIY ===== */
.diy-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  margin-bottom: 24px;
}
.diy-step {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  padding: 22px;
  display: flex; flex-direction: column;
  min-width: 0;
}
.diy-num {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
  color: var(--ink-3); text-transform: uppercase; margin-bottom: 10px;
}
.diy-step h4 {
  font-family: var(--display); font-size: 17px; font-weight: 500;
  letter-spacing: -0.012em; margin: 0 0 8px;
}
.diy-step p {
  font-size: 14px; color: var(--ink-2); margin: 0 0 12px; line-height: 1.55;
  text-wrap: pretty;
}
.diy-step p code {
  font-family: var(--mono); font-size: 0.86em;
  padding: 1px 5px; border-radius: 3px;
  background: var(--bg-2); border: 1px solid var(--line);
  color: var(--ink);
}
.diy-pre {
  margin: auto 0 0; padding: 12px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.55;
  color: var(--ink); white-space: pre-wrap; word-break: break-word;
}
.diy-cta { display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 880px) {
  .diy-grid { grid-template-columns: 1fr; }
  .agent-tabs { grid-template-columns: 1fr 1fr; }
  .ap-head { grid-template-columns: 1fr; gap: 24px; }
}

/* ===== Trouble list ===== */
.ag-trouble { background: var(--bg-2); }
.trouble-list { display: grid; gap: 6px; max-width: 880px; }
.trouble-item {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  overflow: hidden;
  transition: border-color .12s;
}
.trouble-item[open] { border-color: var(--accent-line); }
.trouble-item summary {
  list-style: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  cursor: pointer;
}
.trouble-item summary::-webkit-details-marker { display: none; }
.trouble-item summary h4 {
  font-family: var(--display); font-size: 16px; font-weight: 500;
  letter-spacing: -0.012em; margin: 0; color: var(--ink);
}
.trouble-item summary .plus {
  position: relative; width: 14px; height: 14px;
  flex: 0 0 14px;
}
.trouble-item summary .plus::before,
.trouble-item summary .plus::after {
  content: ''; position: absolute; background: var(--ink-2);
  transition: transform .15s;
}
.trouble-item summary .plus::before { left: 0; right: 0; top: 6px; height: 1.5px; }
.trouble-item summary .plus::after  { top: 0; bottom: 0; left: 6px; width: 1.5px; }
.trouble-item[open] summary .plus::after { transform: scaleY(0); }
.trouble-item p {
  margin: 0; padding: 0 18px 18px;
  color: var(--ink-2); font-size: 14.5px; line-height: 1.6;
}
.trouble-item p code {
  font-family: var(--mono); font-size: 0.86em;
  padding: 1px 5px; border-radius: 3px;
  background: var(--bg-2); border: 1px solid var(--line);
  color: var(--ink);
}
.trouble-item p a {
  color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px;
}
[data-theme="dark"] .trouble-item p a { color: var(--accent); }
