/* Pinned page styles. The assistant's own rules follow at the end of this file. */
:root {
  --ink: #18212f;
  --muted: #556173;
  --paper: #f4f5f7;
  --card: #ffffff;
  --line: #d6dae1;
  --navy: #22304a;
  --good: #1e6b52;
  --good-bg: #e4f1ec;
  --own: #2c5f93;
  --own-bg: #e6eef8;
  --warn: #8a5a00;
  --warn-bg: #fdf1d3;
  --bad: #a3351c;
  --bad-bg: #fbe7e2;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--own); }
code, .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; }
.small { font-size: 12.5px; }
.muted { color: var(--muted); font-size: 14.5px; }

.masthead { background: var(--navy); color: #fff; padding: 36px max(24px, calc((100vw - 1240px) / 2 + 24px)) 26px; }
.brand { margin: 0 0 10px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; font-size: 14px; color: #b9c8e6; }
.masthead h1 { margin: 0 0 12px; font-size: 38px; line-height: 1.15; max-width: 24ch; }
.lede { margin: 0 0 22px; max-width: 78ch; font-size: 17px; color: #dfe6f3; }
.masthead .muted { color: #b9c8e6; margin: 14px 0 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat { background: rgba(255, 255, 255, 0.09); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 10px; padding: 10px 12px; }
.stat strong { display: block; font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13.5px; color: #dfe6f3; }

main, .foot { max-width: 1240px; margin: 0 auto; padding: 24px; }
.columns { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; margin: 20px 0; }
.stack { display: grid; gap: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
h2 { margin: 0 0 10px; font-size: 21px; }
h3 { margin: 0 0 4px; font-size: 18px; }
h4 { margin: 16px 0 6px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
p { margin: 0 0 10px; }
ul { margin: 0 0 10px; padding-left: 20px; }

input, select, button { font: inherit; }
input[type="search"], input[type="url"], select { padding: 8px 10px; border: 1px solid #8b94a3; border-radius: 8px; background: #fff; color: inherit; min-width: 0; }
button { cursor: pointer; font-weight: 600; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--navy); background: var(--navy); color: #fff; margin: 4px 6px 4px 0; }
button.ghost { background: transparent; color: var(--navy); }
button.small { padding: 2px 8px; font-size: 13px; }
:focus-visible { outline: 3px solid #f0a500; outline-offset: 2px; }

.live label { display: block; margin-bottom: 6px; font-size: 14.5px; }
.live .row { display: flex; gap: 8px; }
.live input { flex: 1; }
.live button { margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-bottom: 8px; }
.filters input[type="search"] { flex: 1 1 180px; }
.filters .check { display: flex; gap: 6px; align-items: center; font-size: 14.5px; }

.table-wrap { overflow: auto; max-height: 760px; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { position: sticky; top: 0; background: #eef0f4; text-align: left; padding: 8px 10px; font-size: 13px; }
td { padding: 8px 10px; border-top: 1px solid var(--line); vertical-align: top; }
td strong { display: block; }
.host { display: block; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
td.mono { white-space: nowrap; }
.pin-notes { display: block; font-weight: 700; margin-top: 4px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #f3f6fb; }
tbody tr.selected { background: var(--own-bg); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.badge[data-reach="static"] { background: var(--good-bg); color: var(--good); border-color: #b5d6c9; }
.badge[data-reach="own"] { background: var(--own-bg); color: var(--own); border-color: #bcd0e8; }
.badge[data-reach="declared"] { background: var(--warn-bg); color: var(--warn); border-color: #ead7a0; }
.badge[data-reach="undeclared"] { background: var(--bad-bg); color: var(--bad); border-color: #efc2b6; }
.badge[data-reach="unknown"] { background: #eceef2; color: var(--muted); border-color: var(--line); }

.verdict { display: inline-block; font-weight: 700; font-size: 13px; white-space: nowrap; padding-left: 14px; position: relative; }
.verdict::before { content: ""; position: absolute; left: 0; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; background: var(--muted); }
.verdict[data-verdict="safe_to_call"] { color: var(--good); }
.verdict[data-verdict="safe_to_call"]::before { background: var(--good); }
.verdict[data-verdict="check_first"] { color: var(--warn); }
.verdict[data-verdict="check_first"]::before { background: #c98a00; }
.verdict[data-verdict="dont_call"] { color: var(--bad); }
.verdict[data-verdict="dont_call"]::before { background: var(--bad); }
.verdict-banner { border-radius: 8px; padding: 10px 14px; margin: 10px 0; background: #eceef2; }
.verdict-banner strong { display: block; font-size: 18px; }
.verdict-banner[data-verdict="safe_to_call"] { background: var(--good-bg); color: var(--good); }
.verdict-banner[data-verdict="check_first"] { background: var(--warn-bg); color: var(--warn); }
.verdict-banner[data-verdict="dont_call"] { background: var(--bad-bg); color: var(--bad); }
.verdict-banner span { color: var(--ink); }
.embed { background: #eef0f4; border-radius: 8px; padding: 8px 10px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12.5px; }
.lab-line { margin: 8px 0; }
#lab-result { margin-top: 12px; }
.report[hidden] { display: none; }
#live-result { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.report-head { margin: 10px 0 4px; }
.alert { border-radius: 8px; padding: 8px 12px; background: #eceef2; font-weight: 600; }
.alert.good { background: var(--good-bg); color: var(--good); }
.alert.bad { background: var(--bad-bg); color: var(--bad); }
.checks { list-style: none; padding: 0; font-size: 14px; }
.checks li { padding: 3px 0 3px 12px; border-left: 4px solid var(--line); margin-bottom: 3px; }
.checks li[data-result="pass"] { border-color: #8fc4b0; color: var(--muted); }
.checks li[data-result="warn"] { border-color: #e0b84a; }
.checks li[data-result="fail"] { border-color: var(--bad); color: var(--bad); font-weight: 600; }
.pins { list-style: none; padding: 0; font-size: 14.5px; }
.pins li { padding: 8px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.pins li[data-state="changed"] { background: var(--bad-bg); padding: 8px 10px; border-radius: 8px; color: var(--bad); }
.pins li[data-state="match"] strong::after { content: " ✓"; color: var(--good); }

.grades dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0 0 12px; }
.grades dd { margin: 0; }
.foot { color: var(--muted); font-size: 14.5px; border-top: 1px solid var(--line); }

@media (max-width: 980px) {
  .columns { grid-template-columns: 1fr; }
  .masthead h1 { font-size: 30px; }
  .grades dl { grid-template-columns: 1fr; }
}

/* Assistant layout. Append to the site's stylesheet and set the colors to the site's palette. */
.assistant { margin-top: 20px; }

/* 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: #22304a;
  --ns-accent: #2c5f93;
  --ns-border: #d0d7de;
  --ns-panelbg: #ffffff;
  --ns-msgbg: #f6f8fa;
  --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: 560px; }
/* 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; }
}

.differs { background: rgba(255,255,255,0.08); border-radius: 8px; padding: 6px 16px; margin: 10px 0 16px; max-width: 980px; font-size: 15px; }
.differs ul { margin: 4px 0 8px; padding-left: 20px; }
.differs li { margin: 3px 0; }

.harm { background: rgba(255,255,255,0.10); border-left: 4px solid #f2a600; border-radius: 8px; padding: 4px 16px; margin: 12px 0; max-width: 980px; font-size: 16px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 14px 0; }
.cta .button { display: inline-block; background: #fff; color: #22304a; font-weight: 700; padding: 9px 14px; border-radius: 8px; text-decoration: none; }
.cta .button.ghost-light { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.6); }
.timeline { display: flex; align-items: flex-end; gap: 14px; min-height: 150px; padding: 8px 0 4px; overflow-x: auto; }
.timeline .tl-day { display: flex; flex-direction: column; align-items: center; min-width: 64px; }
.timeline .tl-bars { display: flex; align-items: flex-end; gap: 2px; height: 110px; }
.timeline .tl-bar { width: 18px; border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.timeline .tl-bar span { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 12px; color: #22304a; font-weight: 700; }
.timeline .tl-bar.edits { background: #257de0; }
.timeline .tl-bar.listed { background: #f47230; }
.timeline .tl-label { font-size: 12px; color: #5b6475; margin-top: 4px; text-align: center; }
.tl-legend { display: flex; gap: 16px; font-size: 13px; color: #3b4558; }
.tl-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.masthead h1 { max-width: 980px; }
.cold-open { margin: 14px 0 6px; max-width: 980px; }
.cold-open img { width: 100%; height: auto; border-radius: 10px; border: 3px solid #d64545; background: #fff; display: block; }
.cold-open figcaption { font-size: 14px; color: #dfe6f3; margin-top: 6px; }

.print code { font-size: 13px; }
.print .copy { font-size: 11px; padding: 1px 6px; margin-left: 4px; border-radius: 4px; background: transparent; color: var(--muted); border: 1px solid #c9cfdb; cursor: pointer; }
.diff { border: 1px solid #e1e5ec; border-radius: 8px; padding: 6px 10px; margin: 8px 0; }
.diff-head { margin: 0 0 4px; font-size: 13.5px; color: var(--muted); }
.diff-lines { list-style: none; padding: 0; margin: 0; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.diff-lines li { padding: 2px 6px; border-radius: 4px; margin: 2px 0; overflow-wrap: anywhere; }
.diff-add { background: #e6f4ea; } .diff-del { background: #fbe9e7; } .diff-mod { background: #fff6dd; }
.diff-sign { font-weight: 700; display: inline-block; width: 1em; }
