:root {
  --ink: #14211d;
  --muted: #5d6b66;
  --paper: #f6f3ea;
  --card: #fffdf7;
  --line: #ddd6c4;
  --green: #0f5c4a;
  --green-dark: #0a4638;
  --gold: #b9860b;
  --gold-soft: #f6e7b8;
  --bad: #a3341f;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.55 ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
a { color: var(--green); }
.top, main, footer { max-width: 920px; margin: 0 auto; padding: 0 20px; }
.top { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.coin { width: 22px; height: 22px; border-radius: 50%; background: var(--green); box-shadow: inset 0 0 0 5px var(--green), inset 0 0 0 8px #f3c64d; }
.top nav { display: flex; gap: 20px; font-size: 15px; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--ink); }

.hero { padding: 48px 0 28px; }
h1 { font: 800 clamp(34px, 6vw, 56px)/1.05 ui-serif, Georgia, 'Times New Roman', serif; letter-spacing: -0.02em; margin: 0 0 16px; max-width: 14ch; }
.lead { max-width: 58ch; color: var(--muted); margin: 0 0 28px; }
.scan { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: 0 1px 0 #fff inset, 0 10px 30px -18px rgb(20 33 29 / 0.35); }
.scan label { display: block; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
/* The form rules below name the page's own form and report, so they do not reach the
   assistant's fields and buttons. */
.scan input { flex: 1 1 320px; min-width: 0; height: 52px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font: 16px ui-monospace, SFMono-Regular, Menlo, monospace; }
.scan input:focus { outline: 3px solid var(--gold-soft); border-color: var(--gold); }
.scan button, .result button { height: 52px; padding: 0 24px; border: 0; border-radius: 12px; background: var(--green); color: #fff; font: 700 16px inherit; cursor: pointer; }
.scan button:hover, .result button:hover { background: var(--green-dark); }
.scan button:disabled, .result button:disabled { opacity: 0.6; cursor: progress; }
button.ghost { background: transparent; color: var(--muted); border: 1.5px solid var(--line); height: 42px; font-weight: 600; }
button.ghost:hover { color: var(--ink); background: transparent; border-color: var(--muted); }
.hint { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.status { min-height: 1.5em; margin: 14px 4px 0; color: var(--muted); }
.status.bad { color: var(--bad); font-weight: 600; }

.result { padding: 8px 0 24px; }
.summary { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.big { background: var(--green); color: #fff; border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 4px; }
.big .label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.8; }
.big .value { font: 800 clamp(40px, 8vw, 64px)/1 ui-serif, Georgia, serif; font-variant-numeric: tabular-nums; color: #f8dd86; }
.big .value small { font-size: 0.4em; color: #fff; opacity: 0.85; }
.big .sub { opacity: 0.9; }
.facts { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 8px 20px; display: flex; flex-direction: column; justify-content: center; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 16px 0; }
.group { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.group h3 { margin: 0; font-size: 16px; }
.group .amount { margin: 4px 0 8px; font: 800 24px ui-serif, Georgia, serif; color: var(--gold); font-variant-numeric: tabular-nums; }
.group .how { margin: 0; font-size: 14.5px; color: var(--muted); }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
td a { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
td.ok { color: var(--green); font-weight: 600; white-space: nowrap; }
td.blocked { color: var(--bad); }
.fine { font-size: 14px; color: var(--muted); margin: 14px 4px; }

.prose { padding: 36px 0 8px; max-width: 68ch; }
.prose h2 { font: 800 30px/1.15 ui-serif, Georgia, serif; letter-spacing: -0.01em; margin: 0 0 12px; }
.prose h3 { margin: 24px 0 6px; font-size: 18px; }
.prose li { margin-bottom: 8px; }
footer { padding: 36px 20px 48px; color: var(--muted); font-size: 14px; }

@media (max-width: 640px) {
  .summary { grid-template-columns: 1fr; }
  .top nav { display: none; }
  .hero { padding-top: 24px; }
}

.advanced { margin-top: 14px; font-size: 14px; color: var(--muted); }
.advanced summary { cursor: pointer; }
.advanced label { margin-top: 12px; }
.advanced input { width: 100%; height: 44px; font-size: 14px; }

/* ---- Assistant (agentify-website skill). Colors follow the site's palette. ---- */
.assistant { padding: 36px 0 8px; }
.assistant h2 { font: 800 30px/1.15 ui-serif, Georgia, serif; letter-spacing: -0.01em; margin: 0 0 12px; }
.assistant > p { max-width: 68ch; }
.assistant-note, #assistant-status { font-size: 14px; color: var(--muted); }

/* 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: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ns-bg: #fffdf7;
  --ns-fg: #14211d;
  --ns-primary: #0f5c4a;
  --ns-accent: #8a6408;
  --ns-border: #ddd6c4;
  --ns-panelbg: #fffdf7;
  --ns-msgbg: #f6f3ea;
  --ns-muted: #5d6b66;
}

.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: 720px; }
/* 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; }
}
