/* Agent Commerce: developer portal, docs, OAuth consent, approval pages (ag- prefix). Tokens come from home.css. */
.ag code, .ag-doc code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; background: var(--paper-2); color: var(--ink); padding: 1px 5px; border-radius: 4px; word-break: break-all; }
.ag .muted, .ag-doc .muted { color: var(--ink-3); }
.ag-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 4px; }
.ag-head h2 { margin: 0; font-size: 1.2rem; }
.ag-inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.ag-inline input, .ag-inline select, .ag-form input, .ag-form select { padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; font: inherit; font-size: .92rem; background: #fff; color: var(--ink); min-width: 0; }
.ag-btn { display: inline-flex; align-items: center; padding: 9px 14px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-weight: 600; font-size: .88rem; cursor: pointer; }
.ag-btn:hover { border-color: var(--ink); }
.ag-btn.danger { color: #a62c19; border-color: #f0c3be; }
.ag-link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.ag-metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 20px; }
.ag-metrics > div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.ag-metrics b { display: block; font-family: var(--f-display); font-size: 1.45rem; color: var(--ink); line-height: 1.2; }
.ag-metrics span { color: var(--ink-3); font-size: .78rem; }
.ag-metrics .hot { border-color: #f3d7a6; background: #fdf6ea; }
.ag-secret { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; margin-bottom: 18px; border: 1px solid #bfe3cf; border-left: 4px solid #1f7a4d; border-radius: 10px; background: #effaf3; color: #14462e; }
.ag-secret code { flex: 1; min-width: 220px; background: #fff; padding: 8px 10px; font-size: .88rem; }
.ag-table { width: 100%; border-collapse: collapse; font-size: .88rem; margin-top: 8px; }
.ag-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; padding: 8px 8px; border-bottom: 1px solid var(--line); }
.ag-table td { padding: 8px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: top; }
.ag-table .r { text-align: right; white-space: nowrap; }
.ag-table tr.off td { opacity: .5; }
.ag-table tr.err td { background: #fdf3f1; }
.ag-table .wrap { word-break: break-all; }
.ag-row-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ag-row-actions form { margin: 0; }
.ag-agent { border: 1px solid var(--line); border-radius: 12px; margin-top: 12px; background: var(--card); }
.ag-agent.off { opacity: .75; }
.ag-agent > summary { cursor: pointer; padding: 14px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; list-style: none; color: var(--ink); }
.ag-agent > summary::-webkit-details-marker { display: none; }
.ag-agent > summary .muted { font-size: .82rem; margin-left: auto; }
.ag-agent[open] > summary { border-bottom: 1px solid var(--line); }
.ag-agent > form, .ag-agent > .ag-creds, .ag-agent > .ag-actions { padding: 14px 16px; }
.ag-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 600; background: var(--paper-2); color: var(--ink-2); }
.ag-pill.m-autonomous, .ag-pill.m-prepaid { background: #fdeeeb; color: #a62c19; }
.ag-pill.m-approval { background: #fdf6ea; color: #8a5a0b; }
.ag-pill.off { background: #eceef1; color: #4a5361; }
.ag-form label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-2); margin-bottom: 12px; }
.ag-form label input { display: block; width: 100%; margin-top: 5px; }
.ag-form label small { font-weight: 400; color: var(--ink-3); }
.ag-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ag-modes { border: 0; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.ag-modes legend { font-size: .82rem; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; padding: 0; }
.ag-form .ag-mode, .ag-mode { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px 10px 34px; position: relative; margin: 0; cursor: pointer; font-weight: 400; }
.ag-mode input[type=radio] { position: absolute; left: 12px; top: 13px; width: auto; margin: 0; }
.ag-mode b { color: var(--ink); font-size: .9rem; }
.ag-mode span { color: var(--ink-3); font-size: .8rem; }
.ag-mode span input { display: inline-block; width: auto; margin: 4px 0 0; padding: 6px 8px; }
.ag-mode:has(input:checked) { border-color: var(--accent); background: #fff8f6; }
.ag-checks { display: flex; gap: 12px; margin-top: 8px; font-weight: 400; }
.ag-checks label { display: inline-flex; gap: 6px; align-items: center; margin: 0; font-weight: 400; }
.ag-checks input { display: inline; width: auto; margin: 0; }
.ag-form .ag-confirm { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--ink-2); background: var(--paper-2); padding: 10px 12px; border-radius: 8px; }
.ag-form .ag-confirm input { width: auto; margin: 3px 0 0; display: inline; }
.ag-creds h3 { font-size: 1rem; margin: 0; }
.ag-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ag-actions form { margin: 0; }
.ag-dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; margin: 0 0 16px; }
.ag-dl dt { color: var(--ink-3); font-size: .85rem; }
.ag-dl dd { margin: 0; color: var(--ink); }
/* docs */
.ag-docs { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 36px; align-items: start; }
.ag-docnav { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--card); }
.ag-docnav a { padding: 8px 12px; border-radius: 8px; color: var(--ink-2); font-size: .92rem; font-weight: 500; }
.ag-docnav a:hover { background: var(--paper-2); color: var(--ink); }
.ag-docnav a.on { background: var(--ink); color: #fff; }
.ag-docnav .sep { height: 1px; background: var(--line); margin: 6px 8px; }
.ag-doc h2 { font-size: 1.3rem; margin: 30px 0 10px; color: var(--ink); }
.ag-doc h2:first-child { margin-top: 0; }
.ag-doc p, .ag-doc li { color: var(--ink-2); line-height: 1.65; }
.ag-doc ul { padding-left: 20px; }
.ag-doc li { margin-bottom: 6px; }
.ag-doc pre { background: #11151c; color: #e6e9ef; border-radius: 10px; padding: 16px 18px; overflow-x: auto; font-size: .84rem; line-height: 1.55; }
.ag-doc pre code { background: none; color: inherit; padding: 0; word-break: normal; white-space: pre; }
@media (max-width: 900px) {
    .ag-grid { grid-template-columns: 1fr 1fr; }
    .ag-docs { grid-template-columns: 1fr; gap: 20px; }
    .ag-docnav { position: static; flex-direction: row; flex-wrap: wrap; }
    .ag-docnav .sep { display: none; }
    .ag-dl { grid-template-columns: 1fr; }
}
@media (max-width: 560px) { .ag-grid { grid-template-columns: 1fr; } .ag-agent > summary .muted { margin-left: 0; } }
