:root {
  --ink: #14232f;
  --muted: #52616d;
  --navy: #1d3b53;
  --teal: #0f6f66;
  --sand: #f6f3ec;
  --card: #ffffff;
  --line: #d9dfe3;
  --gold: #b7791f;
  --radius: 14px;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--sand);
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; }
a { color: var(--teal); }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px clamp(16px, 4vw, 48px); background: var(--navy); color: #fff; }
.top a { color: #fff; text-decoration: none; }
.brand { font-weight: 800; font-size: 1.2rem; display: inline-flex; align-items: center; gap: 10px; }
.brand span { color: #7fd1c7; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: url("favicon.svg") center / cover; display: inline-block; }
.top nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: .95rem; }
.top nav a { opacity: .9; }
.top nav a:hover { opacity: 1; text-decoration: underline; }
main { max-width: 1200px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px) 48px; }
.intro { padding: 48px 0 24px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; color: var(--teal); font-weight: 700; margin: 0 0 8px; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.1; margin: 0 0 16px; color: var(--navy); }
.lede { font-size: 1.15rem; max-width: 760px; color: var(--muted); }
.stats { list-style: none; padding: 0; margin: 24px 0 0; display: flex; gap: 12px; flex-wrap: wrap; }
.stats li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; color: var(--muted); }
.stats strong { display: block; font-size: 1.5rem; color: var(--navy); }
.layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel h2 { margin: 0 0 8px; color: var(--navy); font-size: 1.25rem; }
.side { display: grid; gap: 20px; }
.note { color: var(--muted); font-size: .9rem; }
.search label { display: block; font-weight: 600; margin: 8px 0 4px; }
.search input, .search select, .ask textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; }
.search .row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.search .row label { font-weight: 600; }
.search .check { display: flex; align-items: center; gap: 8px; font-weight: 500; white-space: nowrap; padding-bottom: 10px; }
.search .check input { width: auto; }
button { font: inherit; }
#search-go, #ask-send { margin-top: 12px; background: var(--navy); color: #fff; border: 0; border-radius: 10px; padding: 10px 18px; font-weight: 700; cursor: pointer; }
#search-go:hover, #ask-send:hover { background: #142a3c; }
#ask-send:disabled { opacity: .6; cursor: wait; }
.status { min-height: 1.5em; color: var(--muted); font-size: .9rem; }
.results { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.result { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.result-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.result-name { background: none; border: 0; padding: 0; color: var(--navy); font-weight: 800; font-size: 1.05rem; cursor: pointer; text-align: left; text-decoration: underline; text-decoration-color: #9fb3c2; text-underline-offset: 3px; }
.result-desc { margin: 6px 0; font-size: .93rem; }
.result-facts { margin: 0; font-size: .82rem; color: var(--muted); }
.chip { font-size: .72rem; font-weight: 800; border-radius: 999px; padding: 2px 8px; letter-spacing: .04em; }
.chip-a2a { background: #dff3ef; color: var(--teal); }
.chip-mcp { background: #e5ecf6; color: var(--navy); }
.chip-x402 { background: #fbf0d9; color: #7a4f0e; }
.listing h3 { margin: 4px 0; color: var(--navy); }
.listing h4 { margin: 14px 0 4px; font-size: .95rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: .88rem; margin: 10px 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.factors, .skills { font-size: .85rem; padding-left: 18px; margin: 0; }
.ask { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.ask label { font-weight: 700; display: block; margin-bottom: 4px; }
.error { color: #9b1c1c; font-size: .9rem; margin: 6px 0 0; }
.calls { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.call { border-left: 4px solid var(--teal); background: #f8fbfa; border-radius: 8px; padding: 8px 12px; font-size: .9rem; }
.call p { margin: 2px 0; }
.call-head { font-weight: 700; }
.call-answer { white-space: pre-wrap; }
.call-payment_required, .call-rate_limited { border-left-color: var(--gold); background: #fffaf0; }
.call-failed { border-left-color: #9b1c1c; }
.for-sites { margin-top: 24px; }
.for-sites pre { background: var(--sand); padding: 10px 12px; border-radius: 10px; overflow-x: auto; }
footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 24px 16px 40px; }
.assistant-tools { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-top: 12px; }
.assistant-settings summary { cursor: pointer; font-weight: 600; }
.assistant-note { color: var(--muted); font-size: .9rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .search .row { grid-template-columns: 1fr; }
}
/* Assistant layout. Append to the site's stylesheet and set the colors to the site's palette. */
.assistant { margin-top: 48px; }

/* The runtime reads these variables for its chat, settings and agent panels.
   The chat background below also uses --ns-bg. White text sits on --ns-primary (the
   visitor's messages, Send, and the chat form and settings buttons) and on --ns-accent
   (Send while a turn is steered), so give both at least 4.5:1 contrast with white.
   --ns-accent also underlines the chat header. */
#agent-app {
  --ns-font: system-ui, sans-serif;
  --ns-bg: #ffffff;
  --ns-fg: #1f2328;
  --ns-primary: #1d3b53;
  --ns-accent: #0f6f66;
  --ns-border: #d0d7de;
  --ns-panelbg: #ffffff;
  --ns-msgbg: #eef3f2;
  --ns-muted: #59636e;
}

.assistant-panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 16px;
  margin-top: 16px;
}

/* Set the height once the runtime has mounted the chat, so a failed load leaves no
   empty box. */
#agent-app.ns-composed-app [data-ns-slot="chat"] { height: 620px; }
/* The runtime gives the chat no background of its own. Keep --ns-msgbg different from
   --ns-bg, or bot replies lose their bubble. */
#agent-app .ns-chat { background: var(--ns-bg); }

/* Site-wide form rules often stretch the runtime's own controls. Undo them here. */
#agent-app input[type="checkbox"],
#agent-app input[type="radio"] { width: auto; }
#agent-app .ns-header { flex-wrap: wrap; }
/* Site label rules add margins and bold text, and the inputs inside the labels inherit
   the weight. */
#agent-app .ns-settings-body label { margin: 4px 0; font-weight: 400; }
/* Chat forms label radio groups with a legend, so site legend fonts would reach them. */
#agent-app .ns-w-label { font-family: inherit; }
/* Site label rules add margins to chat form fields and make their options bold. */
#agent-app .ns-widget label { margin: 0; }
#agent-app .ns-w-radio label,
#agent-app .ns-w-multi label,
#agent-app .ns-w-toggle { font-weight: 400; }
/* The runtime sizes radio and multi-choice options but not the checkbox label. */
#agent-app .ns-w-toggle { font-size: 13px; }
/* The runtime spaces its buttons with gap. A site's button margin pushes Send below the input. */
#agent-app button { margin: 0; }
/* Chat choices are buttons with a light background. A site's button color can hide their
   titles. */
#agent-app .ns-w-choice { color: var(--ns-fg); }
/* A site's button:hover background also reaches the runtime's plain buttons, behind
   their dark text. Keep the runtime's own backgrounds. */
#agent-app .ns-devtoggle:not(.on):hover,
#agent-app .ns-modal-close:hover { background: transparent; }
#agent-app .ns-w-choice:disabled:hover { background: #fafbfc; }
/* The runtime's message rule hides the partner consent card's own background, and its
   Decline label then has too little contrast. */
#agent-app .ns-consent { background: #fffbeb; }
/* While a consent card waits, the status line above it already says "Contacting", though
   nothing has been sent. Hide it until the visitor answers. */
#agent-app .ns-msgs:has(.ns-consent-actions) > .ns-turn-status { display: none; }
/* Long links in a reply would run out of the bubble on a phone. "anywhere" would also
   let the consent card's buttons shrink and split their labels. */
#agent-app .ns-msg { overflow-wrap: break-word; }
/* On a phone the consent card is too narrow for its three buttons in one row, and
   "Always allow" breaks onto two lines. Keep each label whole and wrap the row. */
#agent-app .ns-consent-actions { flex-wrap: wrap; }
#agent-app .ns-consent-actions button { white-space: nowrap; }

/* site.js and the runtime add their confirmation dialogs to <body>, outside #agent-app.
   Site h2 rules reach the heading, and the two buttons touch. A right margin keeps
   wrapped buttons lined up on the left. */
body > dialog h2 { margin: 0 0 12px; font: 700 1.25em system-ui, sans-serif; }
body > dialog button { margin-right: 8px; }
/* site.js's dialog: the details in two columns, and a plain decline button, so the two
   choices do not look the same. */
.assistant-review { max-width: 640px; width: 85%; max-height: 85vh; overflow: auto; border: 1px solid #888; border-radius: 12px; padding: 24px; font: 16px system-ui, sans-serif; }
.assistant-review dl { display: grid; grid-template-columns: fit-content(40%) 1fr; gap: 4px 16px; margin: 12px 0; }
.assistant-review dt { font-weight: 600; }
.assistant-review dd { margin: 0; overflow-wrap: anywhere; }
.assistant-review details { margin: 12px 0; }
.assistant-review pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.assistant-review .assistant-decline { background: transparent; color: inherit; border: 1px solid currentColor; }

@media (max-width: 760px) {
  .assistant-panels { grid-template-columns: 1fr; }
  /* On a phone, each detail goes under its label, so an email is not split. */
  .assistant-review dl { grid-template-columns: 1fr; gap: 0; }
  .assistant-review dd { margin-bottom: 8px; }
}
