/* One Notice. One accent colour, one set of status colours, system fonts.
   Every text colour below keeps at least 4.5:1 contrast with the background it sits on. */
:root {
  --accent: #4338ca;
  --accent-strong: #3730a3;
  --accent-tint: #eef0ff;
  --accent-line: #c7cbf5;
  --ink: #1c1b29;
  --muted: #55556a;
  --line: #d9d9e3;
  --paper: #ffffff;
  --wash: #f5f5fa;
  --good: #166534;
  --good-tint: #dcfce7;
  --bad: #9f1d1d;
  --bad-tint: #fee2e2;
  --unsure: #7a4b00;
  --unsure-tint: #fef3c7;
  --quiet-tint: #e8e8ef;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(28, 27, 41, 0.05), 0 4px 16px rgba(28, 27, 41, 0.05);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* The footer sits at the bottom of the screen on a short page. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--wash);
}

:where(a) { color: var(--accent-strong); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---- Header, steps, footer (js/layout.js) ---- */

.skip { position: absolute; left: -999px; top: 8px; z-index: 20; padding: 8px 14px; border-radius: 8px; background: var(--paper); font-weight: 600; }
.skip:focus { left: 8px; }

.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.site-header-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  align-items: center;
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 20px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; letter-spacing: -0.01em; text-decoration: none; color: var(--ink); }
.brand svg { color: var(--accent); flex: none; }
.brand-one { color: var(--accent); }
.site-header nav { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-left: auto; }
.site-header nav a { padding: 6px 2px; border-bottom: 2px solid transparent; font-weight: 500; text-decoration: none; color: var(--ink); }
.site-header nav a:hover { border-bottom-color: var(--accent-line); }
.site-header nav a[aria-current="page"] { border-bottom-color: var(--accent); font-weight: 700; }

.steps { background: var(--paper); border-bottom: 1px solid var(--line); }
.steps ol { display: flex; align-items: center; max-width: 1240px; margin: 0 auto; padding: 0 20px; list-style: none; }
.steps li { display: flex; align-items: center; min-width: 0; }
.steps li + li::before { content: ""; flex: none; width: 32px; height: 2px; margin: 0 10px; background: var(--line); }
.steps a { display: flex; align-items: center; gap: 8px; padding: 10px 2px 7px; border-bottom: 3px solid transparent; font-weight: 600; text-decoration: none; color: var(--muted); }
.steps a:hover { color: var(--ink); }
.step-number { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border: 2px solid currentColor; border-radius: 50%; font-size: 13px; font-weight: 700; line-height: 1; }
.steps li.done .step-number { border-color: var(--good); background: var(--good); color: #fff; }
.steps a[aria-current="step"] { border-bottom-color: var(--accent); color: var(--accent-strong); }
.steps a[aria-current="step"] .step-number { border-color: var(--accent); background: var(--accent); color: #fff; }

.site-footer { margin-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.site-footer p { max-width: 1240px; margin: 0 auto; padding: 16px 20px 28px; }

/* ---- Page frame and type ---- */

main { flex: 1 0 auto; width: 100%; max-width: 760px; margin: 0 auto; padding: 8px 20px 40px; }
main.wide, main.home { max-width: 1240px; }
h1 { font-size: 32px; line-height: 1.15; letter-spacing: -0.015em; margin: 24px 0 10px; }
h2 { font-size: 21px; line-height: 1.25; margin: 28px 0 8px; }
h3 { font-size: 17px; margin: 12px 0 4px; }
p { margin: 10px 0; }
.lead { font-size: 19px; }
.hint, .value { display: block; color: var(--muted); font-weight: 400; font-size: 14px; overflow-wrap: anywhere; }
.links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.warning { color: var(--bad); margin: 6px 0; }
.warning:empty { display: none; }

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }

/* ---- Buttons. The assistant's own buttons keep the runtime's look. ---- */

:where(button:not(#agent-app button), .button) {
  display: inline-block;
  font: inherit;
  font-weight: 650;
  line-height: 1.25;
  padding: 10px 18px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}
:where(button:not(#agent-app button), .button):hover { border-color: var(--accent-strong); background: var(--accent-strong); }
.quiet, .quiet:hover { background: var(--paper); color: var(--accent-strong); }
.quiet:hover { background: var(--accent-tint); }
.danger, .danger:hover { border-color: var(--bad); color: var(--bad); }
.danger:hover { background: var(--bad-tint); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---- Status chips: one look for every state, on every page ---- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  background: var(--quiet-tint);
  color: #3b3b4d;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.chip[data-state="none"]::before, .chip[data-state="proposed"]::before { background: transparent; box-shadow: inset 0 0 0 2px currentColor; }
.chip[data-state="proposed"] { background: var(--accent-tint); color: var(--accent-strong); }
.chip[data-state="planned"], .chip[data-state="sending"] { background: var(--accent-tint); color: var(--accent-strong); }
.chip[data-state="accepted"] { background: var(--good-tint); color: var(--good); }
.chip[data-state="declined"] { background: var(--bad-tint); color: var(--bad); }
.chip[data-state="unknown"] { background: var(--unsure-tint); color: var(--unsure); }
.chip[data-state="not_sent"] { box-shadow: inset 0 0 0 1.5px #8a8a9c; }

/* ---- Forms (My move, and the tick boxes on Plan and send) ---- */

.panel { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
form { display: grid; gap: 16px; }
:where(label:not(#agent-app label)) { display: grid; gap: 4px; align-content: start; font-weight: 600; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
label.check input { flex: none; width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--accent); }
:where(input:not([type="checkbox"], [type="radio"]):not(#agent-app input)) {
  width: 100%;
  font: inherit;
  padding: 9px 10px;
  border: 1px solid #77778a;
  border-radius: 8px;
  min-height: 44px;
  background: var(--paper);
  color: var(--ink);
}
fieldset { display: grid; gap: 12px; min-width: 0; margin: 0; padding: 0; border: 0; }
/* A floated legend is laid out as the first item of the fieldset's grid, so the gap and a
   rule above the fieldset both work. */
:where(legend:not(#agent-app legend)) { float: left; grid-column: 1 / -1; width: 100%; padding: 0; font-size: 17px; font-weight: 700; }
.fields { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 16px; }
.fields .whole { grid-column: 1 / -1; }
form > fieldset + fieldset { padding-top: 18px; border-top: 1px solid var(--line); }
.organisation { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.organisation:has(input:checked) { border-color: var(--accent-line); background: var(--accent-tint); }
.organisation label.check { font-weight: 600; }
.organisation label:not(.check) { margin-left: 28px; font-weight: 400; }

.callout { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin: 16px 0; padding: 12px 16px; border: 1px solid var(--accent-line); border-radius: var(--radius); background: var(--accent-tint); }
.callout p { margin: 0; }

.empty { margin: 16px 0; padding: 20px; border: 1px dashed #8a8a9c; border-radius: var(--radius); background: var(--paper); }
.empty h2 { margin-top: 0; }
.empty[hidden] { display: none; }

/* ---- Home ---- */

.hero { display: grid; gap: 24px 48px; align-items: center; padding: 16px 0 8px; }
.hero h1 { font-size: clamp(34px, 5vw, 46px); margin-top: 8px; }
.eyebrow { margin: 0; color: var(--accent-strong); font-size: 14px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.hero .actions { margin: 20px 0 8px; }
.who-sees { margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); }
.who-sees svg { display: block; width: 100%; height: auto; }
.who-sees figcaption { margin-top: 8px; color: var(--muted); font-size: 14px; }
.diagram-frame { fill: var(--wash); stroke: var(--line); stroke-width: 1.5; }
.diagram-box { fill: var(--paper); stroke: var(--line); stroke-width: 1.5; }
.diagram-box.yours { stroke: var(--accent); stroke-width: 2; }
.diagram-title { font-size: 15px; font-weight: 700; fill: var(--ink); }
.diagram-kicker { font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; fill: var(--muted); }
.diagram-name { font-size: 13px; fill: var(--muted); }
.diagram-value { font-size: 13px; font-weight: 600; fill: var(--ink); }
.diagram-hidden { fill: #cfcfdb; }
.diagram-note { font-size: 13px; fill: var(--ink); }
.diagram-note.strong { font-weight: 700; fill: var(--accent-strong); }
.diagram-sent { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.diagram-asked { fill: none; stroke: var(--muted); stroke-width: 2; stroke-dasharray: 5 4; }
.diagram-head { fill: var(--accent); }
.diagram-head.asked { fill: var(--muted); }

.points { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin: 12px 0; padding: 0; list-style: none; }
.points li { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.points h3 { margin: 0 0 4px; }
.points p { margin: 0; color: var(--muted); }
.control { display: grid; gap: 8px; margin: 12px 0; padding: 0; list-style: none; }
.control li { position: relative; padding-left: 30px; }
.control li::before { content: ""; position: absolute; left: 6px; top: 5px; width: 7px; height: 12px; border: solid var(--good); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }

/* ---- Plan and send ---- */

.plan-layout { display: grid; gap: 24px; }
.plan-layout > * { min-width: 0; }
.jump { position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; margin: 0 -20px; padding: 8px 20px; border-bottom: 1px solid var(--line); background: var(--wash); }
.jump a { flex: 1; padding: 8px 10px; border: 1.5px solid var(--accent); border-radius: 999px; background: var(--paper); color: var(--accent-strong); font-weight: 650; text-align: center; text-decoration: none; }
.jump a.primary { background: var(--accent); color: #fff; }
#plan, #assistant { scroll-margin-top: 64px; }

.next { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; margin: 16px 0; padding: 12px 16px; border: 1px solid var(--accent-line); border-radius: var(--radius); background: var(--accent-tint); }
.next:empty { display: none; }
.next strong { flex: none; color: var(--accent-strong); }
.next p { flex: 1 1 260px; margin: 0; }
.next:focus { outline: none; }
.next button { flex: none; }

.card { margin: 12px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.card[data-state="accepted"] { border-left: 5px solid var(--good); }
.card[data-state="declined"], .card[data-state="not_sent"] { border-left: 5px solid var(--bad); }
.card[data-state="unknown"] { border-left: 5px solid var(--unsure); }
.card summary { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 2px 12px; align-items: center; padding: 14px 16px; border-radius: var(--radius); list-style: none; cursor: pointer; }
.card summary::-webkit-details-marker { display: none; }
.card summary:hover { background: var(--wash); }
.card-name { margin: 0; font-size: 18px; }
.card-meta { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 14.5px; }
.card-toggle { width: 10px; height: 10px; margin: 0 4px 4px; border: solid var(--muted); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); transition: transform 0.15s; }
details[open] > summary .card-toggle { margin: 4px 4px 0; transform: rotate(-135deg); }
.card-body { padding: 4px 16px 16px; border-top: 1px solid var(--line); }
.card-body fieldset { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px 16px; margin: 14px 0; }
.card-body legend { font-size: 16px; }
.plan-line { font-weight: 600; margin-bottom: 0; }
.plan-line + p { margin-top: 2px; }
.leaves { margin: 12px 0; padding: 10px 14px; border-radius: 8px; background: var(--accent-tint); overflow-wrap: anywhere; }
.card > .result { margin: 0 16px 14px; }
.card > .sent-note { margin: -4px 16px 14px; font-weight: 600; }
.sent-note:empty { display: none; }
.card > .warning { margin: 0 16px 12px; }
/* The assistant's proposal: beside the person's own ticks, and never ticked for them. */
.proposal { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 0 16px 14px; padding: 10px 14px; border: 1px dashed var(--accent); border-radius: 8px; background: var(--accent-tint); }
.proposal:empty { display: none; }
.proposal p { flex: 1 1 240px; margin: 0; }
.proposal button { flex: none; padding: 8px 14px; }
.tag { display: inline-block; margin-left: 8px; padding: 0 7px; border: 1px solid var(--accent-line); border-radius: 999px; background: var(--accent-tint); color: var(--accent-strong); font-size: 12px; font-weight: 700; }

.result:empty { display: none; }
.result { padding: 8px 14px; border-left: 4px solid var(--line); border-radius: 8px; background: var(--wash); overflow-wrap: anywhere; }
.result > :first-child { margin-top: 0; }
.result > :last-child { margin-bottom: 0; }
.result ul { margin: 6px 0; padding-left: 22px; }
.asks { font-weight: 600; }
.own-words { margin: 6px 0; font-size: 14px; }
.own-words summary { display: list-item; cursor: pointer; }
.result.accepted { border-left-color: var(--good); background: var(--good-tint); }
.result.declined, .result.not_sent { border-left-color: var(--bad); background: var(--bad-tint); }
.result.unknown { border-left-color: var(--unsure); background: var(--unsure-tint); }
.result.sending { border-left-color: var(--accent); background: var(--accent-tint); }

.leaves-all { margin-top: 24px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.leaves-all h2 { margin: 0 0 6px; font-size: 18px; }
.leaves-all ul { margin: 0; padding-left: 20px; color: var(--muted); font-size: 15px; }
.leaves-all li { margin: 4px 0; }

/* ---- The assistant: a panel beside the plan on a wide screen ---- */

.assistant {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  padding: 14px 16px 12px;
  border: 1px solid var(--accent-line);
  border-top: 5px solid var(--accent);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 8px 28px rgba(28, 27, 41, 0.1);
}
/* Each part takes a row of its own, after the heading's row. */
.assistant > *, #agent-app > * { flex: 0 0 100%; order: 2; min-width: 0; max-width: 100%; }
.assistant > h2 { flex: 0 0 auto; order: 0; margin: 0; font-size: 20px; white-space: nowrap; }
.assistant p { margin: 0; }
#assistant-status { font-size: 14px; color: var(--muted); }
.suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.suggestions[hidden] { display: none; }
.suggestion { padding: 4px 11px; border-width: 1.5px; border-radius: 999px; background: var(--accent-tint); color: var(--accent-strong); font-size: 13px; }
.suggestion:hover { background: var(--accent); color: #fff; }
/* The two closed disclosures share the last row. An open one takes a row of its own. */
#agent-app > .assistant-settings, .assistant-about { flex: 0 1 auto; }
#agent-app > .assistant-settings[open], .assistant-about[open] { flex-basis: 100%; }
.assistant-settings { font-size: 13px; color: var(--muted); }
.assistant-settings > summary { cursor: pointer; }
.assistant-dev { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.assistant-dev:empty { display: none; }
#agent-app .assistant-dev .ns-action-status { flex: 1 1 100%; padding: 0 !important; }
/* Demo mode, said calmly, with the way to a real model next to it. */
.mode-tag { flex: 0 1 auto; order: 1; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--wash); color: var(--muted); font-size: 13px; }
.mode-tag[hidden] { display: none; }
button.link { padding: 0; border: 0; background: none; color: var(--accent-strong); font: inherit; text-decoration: underline; cursor: pointer; }
button.link:hover { background: none; color: var(--accent); }
/* A message from the page itself in the chat: an accepted plan, a notice sent from a card. */
#agent-app .ns-msg.page-note { border-left: 4px solid var(--accent); background: var(--accent-tint); }
.assistant-about { font-size: 13px; color: var(--muted); }
.assistant-about summary { cursor: pointer; }
.assistant-about p { margin: 8px 0 0; font-size: 14px; }
.assistant-note { padding: 8px 12px; border-left: 4px solid var(--unsure); border-radius: 6px; background: var(--unsure-tint); color: var(--ink); }

/* The runtime reads these variables for its chat, settings and agent panels. White text sits
   on --ns-primary and --ns-accent, so both keep at least 4.5:1 contrast with white. */
#agent-app {
  /* The slots sit straight in the panel, so the runtime's header shares a row with the heading. */
  display: contents;
  --ns-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ns-bg: #ffffff;
  --ns-fg: #1c1b29;
  --ns-primary: #4338ca;
  --ns-accent: #4338ca;
  --ns-border: #d9d9e3;
  --ns-panelbg: #f5f5fa;
  --ns-msgbg: #f0f0f7;
  --ns-muted: #55556a;
  --ns-radius: 12px;
}
#agent-app > [data-ns-slot="header"] { flex: 1 1 auto; order: 1; }
/* The panel's own heading names the assistant. In demo mode the tag beside it says so, and the
   runtime's mock badge is not shown; a real model's badge is. The page's address is not repeated. */
#agent-app .ns-header { padding: 0; border-bottom: 0; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
#agent-app .ns-title, #agent-app .ns-breadcrumb, #agent-app .ns-llmbadge.mock { display: none; }
#agent-app .ns-llmbadge { margin-left: 0; color: #7c2d12; }
#agent-app .ns-llmbadge.real { color: var(--good); }

/* 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: min(68vh, 520px); }
#agent-app.ns-composed-app [data-ns-slot="chat"] > .ns-chat { min-height: 0; background: var(--ns-bg); }
#agent-app .ns-msgs { font-size: 15px; }
#agent-app .ns-msg { overflow-wrap: break-word; }
#agent-app .ns-msg a { color: var(--accent-strong); }
#agent-app .ns-msg.user a { color: inherit; }
#agent-app .ns-inputbar input { font-size: 15px; }

/* The agents at work, as a strip under the chat. */
#agent-app .ns-agents { gap: 6px; padding: 0; border: 0; background: transparent; overflow: visible; }
#agent-app #ns-anodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
#agent-app .ns-anode { min-width: 0; padding: 3px 10px; gap: 8px; }
#agent-app .ns-anode .ns-aicon { display: none; }
#agent-app[data-dev="true"] [data-ns-slot="agents"] { height: 340px; }

/* This site's table rules reach the runtime's chat. */
/* An answer with a table gets the chat's full width, and long names wrap inside their
   column, so the plan needs no sideways scrolling. */
#agent-app .ns-msg.bot:has(table) { max-width: 100%; }
#agent-app .ns-msg table { table-layout: fixed; font-size: 13.5px; }
#agent-app th, #agent-app td { padding: 6px; overflow-wrap: anywhere; }
/* The runtime's message rule hides the 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; }
#agent-app .ns-consent-actions { flex-wrap: wrap; }
#agent-app .ns-consent-actions button { white-space: nowrap; }
#agent-app .ns-consent-count { color: var(--accent-strong); font-weight: 700; }
#agent-app .ns-consent-sub { font-family: var(--ns-font); font-size: 14px; color: var(--ink); }
#agent-app .ns-consent-host { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
#agent-app .ns-consent-label { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
#agent-app .ns-consent-help { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
#agent-app .ns-consent-done ~ .ns-consent-help { display: none; }
#agent-app .ns-w-choice { color: var(--ns-fg); }
#agent-app .ns-settings { border-top: 0; font-size: 13px; }
#agent-app .ns-settings summary { padding: 2px 0; }

/* ---- Confirmation dialogs. site.js and the runtime add them to <body>, outside #agent-app. ---- */

dialog::backdrop { background: rgba(28, 27, 41, 0.62); }
body > dialog { color: var(--ink); }
body > dialog h2 { margin: 0 0 12px; font: 700 1.25em system-ui, sans-serif; }
body > dialog button { margin-right: 8px; }
dialog.assistant-review {
  width: min(580px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100vh - 24px);
  padding: 22px 24px 20px;
  border: 0;
  border-top: 6px solid var(--accent);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
  overflow: auto;
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.assistant-review h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -0.01em; }
/* The heading takes focus when the dialog opens. It is not a control, so it shows no ring. */
.assistant-review h2:focus { outline: none; }
.assistant-review > p { margin: 0 0 14px; color: var(--muted); }
.assistant-review dl { display: grid; grid-template-columns: minmax(110px, 34%) minmax(0, 1fr); margin: 0 0 12px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.assistant-review dt, .assistant-review dd { margin: 0; padding: 9px 14px; border-top: 1px solid var(--line); }
.assistant-review dt { background: var(--wash); color: var(--muted); font-weight: 600; }
.assistant-review dd { font-weight: 650; overflow-wrap: anywhere; }
.assistant-review .review-destination { grid-column: 1 / -1; border-top: 0; background: var(--accent-tint); }
.assistant-review dt.review-destination { padding-bottom: 0; color: var(--accent-strong); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.assistant-review dd.review-destination { padding-top: 2px; font-size: 18px; font-weight: 700; }
.assistant-review details { margin: 0 0 16px; font-size: 14px; color: var(--muted); }
.assistant-review summary { cursor: pointer; }
.assistant-review pre { margin: 8px 0 0; padding: 10px; border-radius: 8px; background: var(--wash); white-space: pre-wrap; overflow-wrap: anywhere; }
.review-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.review-actions button { margin: 0; padding: 12px 22px; font-size: 17px; }

/* ---- Receipts ---- */

.verdict-panel { margin: 16px 0 8px; padding: 16px 18px; border: 1px solid var(--line); border-left: 6px solid #8a8a9c; border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.verdict-panel h2 { margin: 0; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.verdict-panel[data-ok="true"] { border-left-color: var(--good); background: var(--good-tint); }
.verdict-panel[data-ok="false"] { border-left-color: var(--bad); background: var(--bad-tint); }
#verdict { margin: 4px 0; font-size: 20px; font-weight: 700; line-height: 1.3; }
#verdict[data-ok="true"] { color: var(--good); }
#verdict[data-ok="false"] { color: var(--bad); }
.fingerprint { margin: 4px 0 12px; color: var(--ink); font-size: 14px; }
.fingerprint:empty { display: none; }
.fingerprint summary, .entry-more summary { cursor: pointer; }
.fingerprint code, .entry-meta, .entry-more dd { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }
/* A whole hash has no place to break, so it is shown only when asked for and may break anywhere. */
.fingerprint code { display: block; margin-top: 4px; overflow-wrap: anywhere; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.filters:empty { display: none; }
.filter { padding: 5px 12px; border-width: 1.5px; border-radius: 999px; background: var(--paper); color: var(--accent-strong); font-size: 14px; }
.filter:hover { background: var(--accent-tint); }
.filter[aria-pressed="true"], .filter[aria-pressed="true"]:hover { background: var(--accent); color: #fff; }

.timeline { margin: 16px 0; padding: 0; list-style: none; }
.timeline li { position: relative; padding: 0 0 18px 30px; }
.timeline li[hidden] { display: none; }
.timeline li::before { content: ""; position: absolute; left: 3px; top: 5px; width: 14px; height: 14px; border: 3px solid var(--accent); border-radius: 50%; background: var(--paper); }
.timeline li::after { content: ""; position: absolute; left: 9px; top: 23px; bottom: 1px; width: 2px; background: var(--line); }
.timeline li[data-tone="good"]::before { border-color: var(--good); background: var(--good); }
.timeline li[data-tone="bad"]::before { border-color: var(--bad); background: var(--bad); }
.timeline li[data-tone="unsure"]::before { border-color: var(--unsure); background: var(--unsure); }
.timeline li[data-tone="quiet"]::before { border-color: #8a8a9c; }
.entry-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin: 0; }
.entry-kind { font-weight: 700; }
.entry-org { padding: 1px 8px; border-radius: 999px; background: var(--quiet-tint); color: #3b3b4d; font-size: 13px; font-weight: 600; }
.entry-text { margin: 2px 0; overflow-wrap: anywhere; }
.entry-meta { margin: 0; color: var(--muted); }
.entry-more dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 12px; margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.entry-more dt { font-weight: 600; }
.entry-more dd { margin: 0; overflow-wrap: anywhere; }

/* ---- Wide screens ---- */

@media (min-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 460px); padding-top: 28px; }
}

@media (min-width: 1000px) {
  .plan-layout { grid-template-columns: minmax(0, 1fr) clamp(420px, 42vw, 520px); gap: 32px; align-items: start; }
  .jump { display: none; }
  .plan-layout > .assistant { position: sticky; top: 12px; margin-top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
  /* The whole panel fits the first screen: it starts under the header and the steps. */
  #agent-app.ns-composed-app [data-ns-slot="chat"] { height: clamp(300px, calc(100vh - 446px), 640px); }
}

/* ---- Phones ---- */

@media (max-width: 520px) {
  main { padding: 4px 16px 32px; }
  h1 { font-size: 28px; }
  .site-header-inner { padding: 10px 16px; }
  .steps ol { padding: 0 16px; }
  .steps a { gap: 6px; font-size: 13.5px; }
  .steps li + li::before { width: 10px; margin: 0 5px; }
  .step-number { width: 22px; height: 22px; font-size: 12px; }
  .jump { margin: 0 -16px; padding: 8px 16px; }
  .panel { padding: 16px; }
  .card summary { padding: 12px 14px; }
  .assistant { padding: 12px; }
  dialog.assistant-review { padding: 18px 16px 16px; }
  .assistant-review dl { grid-template-columns: 1fr; }
  .assistant-review dt { padding-bottom: 0; border-top: 1px solid var(--line); background: transparent; font-size: 14px; }
  .assistant-review dd { padding-top: 0; border-top: 0; }
  .assistant-review dt.review-destination { padding-top: 9px; }
  .review-actions button { flex: 1 1 100%; }
  .hero .actions > * { flex: 1 1 100%; text-align: center; }
}

/* How it works: checks */
.checks-table { margin: 12px 0; border: 1px solid var(--line); border-radius: var(--radius); border-collapse: separate; border-spacing: 0; background: var(--paper); box-shadow: var(--shadow); }
.checks-table th, .checks-table td { padding: 12px 14px; }
.checks-table thead th { color: var(--muted); font-size: 14px; }
.checks-table tbody tr:nth-last-child(-n+2) > * { border-bottom: 0; }
.checks-table th[scope="row"] { font-weight: 400; }
.checks-table tr:not(.check-evidence) > td { width: 1%; white-space: nowrap; }
.check-requirement { display: block; font-weight: 650; }
.check-toggle { margin-top: 8px; padding: 4px 12px; border-width: 1.5px; font-size: 14px; }
.check-evidence > td { padding-top: 4px; background: var(--wash); overflow-wrap: anywhere; }
.check-evidence h3 { margin: 12px 0 4px; font-size: 15px; }
.check-evidence ul { margin: 0; padding-left: 20px; font-size: 15px; }
.check-evidence li { margin: 6px 0; }
.check-evidence p { margin: 0; font-size: 15px; }
.check-missing { color: var(--bad); }
.check-addresses { padding-left: 20px; overflow-wrap: anywhere; }

/* Home: what makes it an agentic-web entry, and the proof. */
.agentic { margin: 8px 0; padding-left: 12px; border-left: 4px solid var(--accent); font-weight: 600; }
.proof { margin: 8px 0; font-weight: 650; }

/* My move: who needs a detail, and where the demo copies are after clearing. */
.need { color: var(--accent-strong); font-weight: 600; }
.cleared { padding: 12px 16px; border: 1px solid var(--accent-line); border-radius: var(--radius); background: var(--accent-tint); }
.cleared[hidden] { display: none; }
.cleared p { margin: 4px 0; }

/* Plan and send: what an organisation still needs, on the card even when it is closed. */
.card > .needs { margin: 0 16px 14px; padding: 8px 14px; border-left: 4px solid var(--bad); border-radius: 8px; background: var(--bad-tint); }
.card > .needs:empty { display: none; }
.needs p { margin: 4px 0; }
.checked { margin-top: 10px; }
.checked .actions { margin: 6px 0; }
.checked-form { margin-top: 8px; }
.checked-form[hidden] { display: none; }
.result .send-again { margin-top: 6px; }
.review-warnings { margin: 0 0 14px; padding: 10px 14px 10px 32px; border-left: 4px solid var(--bad); border-radius: 8px; background: var(--bad-tint); color: var(--ink); font-weight: 600; }
.review-warnings li { margin: 2px 0; }

/* Receipts: the outcome of each notice first, then each entry under its number and time. */
.outcomes { margin: 16px 0; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.outcomes[hidden] { display: none; }
.outcomes h2 { margin: 0 0 6px; font-size: 18px; }
.outcomes ul { margin: 0; padding: 0; list-style: none; }
.outcomes li { margin: 4px 0; padding-left: 14px; border-left: 4px solid var(--line); }
.outcomes li[data-tone="good"] { border-left-color: var(--good); }
.outcomes li[data-tone="bad"] { border-left-color: var(--bad); }
.outcomes li[data-tone="unsure"] { border-left-color: var(--unsure); }
.entry-number { margin: 0; color: var(--muted); font-size: 13px; font-weight: 600; }
#checked-at { margin: 0; font-weight: 600; color: var(--ink); }
.verdict-panel.flash { animation: flash 0.9s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 6px var(--accent-line); } to { box-shadow: var(--shadow); } }
@media (prefers-reduced-motion: reduce) { .verdict-panel.flash { animation: none; } }
