/* The Agents tab (rh-agents.js). Colours come from the tokens, so dark mode follows; the transcript and the command
   snippet are dark in both themes, like a terminal, and get their own dark-theme edge below. */
.ag-lede { margin-top: 6px; font-size: 16px; color: var(--text-2); }
.ag-count { display: flex; align-items: baseline; gap: 12px; margin-top: 6px; }
.ag-count .big { margin-top: 0; }
.ag-count-l { font-size: 15px; font-weight: 600; }
.ag-count-l span { margin-left: 6px; color: var(--text-3); font-weight: 500; }

/* The worked example, where the chart sits on a stock's page. */
.ag-term { display: grid; align-content: center; gap: 1px; margin-top: 18px; height: clamp(220px, calc(100vh - 544px), 460px); padding: 22px 26px; overflow: auto; border-radius: 16px; background: #0E0E11; color: #B9BAC0; font: 14px/1.75 ui-monospace, SFMono-Regular, Menlo, monospace; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04), 0 24px 48px -32px rgba(13, 13, 15, .55); }
.ag-l { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; transition: opacity .25s; }
.ag-l.in { animation: ag-line .45s cubic-bezier(.2, .7, .1, 1) both; }
.ag-l.dim { opacity: .28; }
@keyframes ag-line { from { opacity: 0; transform: translateY(4px); } }
.ag-who { color: #76777E; }
.ag-say { min-width: 0; overflow-wrap: anywhere; }
.ag-you { color: #FFFFFF; font-weight: 600; }
.ag-to { color: #F2935F; }
.ag-say b { color: #FFFFFF; font-weight: 600; }
.ag-args { color: #8F9097; }
.ag-from { color: #5E5F66; }
.ag-say i { font-style: normal; color: #F2935F; margin-right: 4px; }
.ag-sign { color: #3FD39A; }
.ag-steps button { white-space: nowrap; }

/* Tools: filter chips and one row per tool. */
.ag-sub { margin-top: 14px; max-width: 62ch; font-size: 15px; color: var(--text-2); line-height: 1.55; }
.ag-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.ag-filter button { height: 34px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; background: none; font: 600 14px var(--ui); color: var(--ink); cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.ag-filter button:hover { border-color: var(--ink); }
.ag-filter button span { margin-left: 6px; color: var(--text-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.ag-filter button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--canvas); }
.ag-filter button[aria-pressed="true"] span { color: inherit; opacity: .65; }
.ag-tools { margin-top: 10px; }
.ag-tool { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) 78px 34px; grid-template-areas: "name desc tag copy"; gap: 18px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.ag-tname { grid-area: name; min-width: 0; }
.ag-tname code { font: 600 14px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); }
.ag-tname small { display: block; margin-top: 2px; font-size: 13px; color: var(--text-3); }
.ag-tdesc { grid-area: desc; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.ag-tag { grid-area: tag; justify-self: start; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; }
.ag-tag.read { background: color-mix(in srgb, var(--up) 12%, transparent); color: var(--up); }
.ag-tag.prep { background: color-mix(in srgb, var(--act) 13%, transparent); color: var(--act-ink); }
.ag-copy { grid-area: copy; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--text-3); cursor: pointer; transition: color .15s, border-color .15s; }
.ag-copy:hover { color: var(--ink); border-color: var(--line-2); }

/* Does and doesn't. */
.ag-scope { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; }
.ag-scope h3 { padding: 18px 0 4px; font: 650 15px var(--ui); }
.ag-scope li { position: relative; padding: 12px 0 12px 32px; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.5; color: var(--text-2); }
.ag-scope li::before { content: ""; position: absolute; left: 0; top: 13px; width: 20px; height: 20px; border-radius: 50%; }
.ag-scope li.yes::before { background: color-mix(in srgb, var(--up) 14%, transparent); }
.ag-scope li.yes::after { content: ""; position: absolute; left: 7px; top: 17px; width: 5px; height: 9px; border-right: 2px solid var(--up); border-bottom: 2px solid var(--up); transform: rotate(45deg); }
.ag-scope li.no::before { background-color: var(--sunk); background-image: linear-gradient(45deg, transparent 44%, var(--text-3) 44% 56%, transparent 56%), linear-gradient(-45deg, transparent 44%, var(--text-3) 44% 56%, transparent 56%); background-size: 9px 9px; background-position: center; background-repeat: no-repeat; }

.ag-safe dd { line-height: 1.5; }

/* Models: the Raeto partner card. */
.ag-partner { margin-top: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; }
.ag-prow { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.ag-prow:last-child { border-bottom: 0; }
.ag-prow b { display: block; font-size: 15px; font-weight: 650; }
.ag-prow span { display: block; max-width: 60ch; margin-top: 3px; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.ag-url { flex: none; height: 34px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--sunk); font: 500 13px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); cursor: pointer; transition: border-color .15s; }
.ag-url:hover { border-color: var(--ink); }
a.ag-url { display: inline-flex; align-items: center; text-decoration: none; }

/* For operators: the fee share in three numbers. */
/* The agent credit markets (rh-agents.js creditHtml): one block per market, its name over its numbers. */
.ag-credit-m { margin-top: 18px; }
.ag-credit-m h3 { margin: 0 0 2px; font-size: 17px; font-weight: 650; }
.ag-credit-m .fine { margin-top: 8px; }
.ag-ops { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.ag-ops div { padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.ag-ops strong { display: block; font: 600 30px/1.1 var(--display); letter-spacing: -.02em; color: var(--act-ink); font-variant-numeric: tabular-nums; }
.ag-ops span { display: block; margin-top: 8px; font-size: 14px; line-height: 1.45; color: var(--text-2); }
.ag-ops-go { margin-top: 18px; }
/* Hold $BORRO (Holder Credit): the pitch, the benefits as cards two by two (an odd last one across the row), then the
   rule. */
.ag-hold-lede { margin-top: 8px; font: 600 22px/1.25 var(--display); letter-spacing: -.015em; color: var(--act-ink); }
.ag-ops.ag-hold { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ag-ops.ag-hold div { position: relative; padding: 20px 22px 20px 64px; }
.ag-ops.ag-hold div:last-child:nth-child(odd) { grid-column: 1 / -1; }
.ag-ops.ag-hold strong { font-size: 20px; line-height: 1.2; letter-spacing: -.01em; color: var(--ink); }
.ag-ops.ag-hold span { max-width: 52ch; }
.ag-ops.ag-hold .ag-hold-n { position: absolute; left: 20px; top: 19px; margin: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font: 650 13px/1 var(--ui); color: var(--act-ink); background: color-mix(in srgb, var(--act-ink) 12%, transparent); font-variant-numeric: tabular-nums; }
.ag-hold-rule { margin-top: 14px; padding: 12px 16px; border-radius: 12px; background: var(--sunk); font-size: 15px; font-weight: 600; line-height: 1.45; }

/* The right card: connect a client. pro.css lays .panel-head out as a row with a rule under it; this one is a title
   over a line of text. */
.ag-rail .panel-head { display: block; border-bottom: 0; }
.ag-end { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding: 9px 9px 9px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--sunk); }
.ag-end span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 14px ui-monospace, SFMono-Regular, Menlo, monospace; }
.ag-btn { flex: none; height: 30px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); font: 650 13px var(--ui); color: var(--ink); cursor: pointer; transition: border-color .15s; }
.ag-btn:hover { border-color: var(--ink); }
.ag-ctabs { margin-top: 18px; }
.ag-how { margin-top: 12px; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.ag-snip { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; margin: 10px 0 6px; padding: 12px 10px 12px 14px; border-radius: 12px; background: #0E0E11; color: #E9E9E6; }
.ag-snip pre { margin: 0; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.ag-snip .ag-btn { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); color: #FFFFFF; }
.ag-snip .ag-btn:hover { border-color: rgba(255, 255, 255, .5); }

/* Dark theme: the terminal surfaces need an edge against the near-black page. */
:root[data-theme="dark"] .ag-term, :root[data-theme="dark"] .ag-snip { background: #0F0F12; box-shadow: inset 0 0 0 1px var(--line-2); }

@media (prefers-reduced-motion: reduce) {
  .ag-l.in { animation: none; }
}
@media (max-width: 980px) {
  .ag-ops { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .ag-ops.ag-hold { grid-template-columns: minmax(0, 1fr); }
  .ag-ops.ag-hold div { padding: 16px 18px 16px 58px; }
  .ag-ops.ag-hold .ag-hold-n { left: 18px; top: 15px; }
  .ag-term { height: auto; padding: 16px; font-size: 12px; }
  .ag-l { grid-template-columns: 50px minmax(0, 1fr); gap: 10px; }
  .ag-tool { grid-template-columns: minmax(0, 1fr) auto 34px; grid-template-areas: "name tag copy" "desc desc desc"; gap: 6px 12px; }
  .ag-scope { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .ag-prow { flex-direction: column; align-items: flex-start; }
  .ag-steps { overflow-x: auto; }
}
