/* Endpoint Primer. Page styles first, then the assistant. */

:root {
  --ink: #17252a;
  --muted: #55676d;
  --paper: #f6f7f4;
  --card: #ffffff;
  --line: #d6ddd9;
  --brand: #5b3a8c;
  --brand-dark: #3f2763;
  --gold: #f4d58d;
  --estimated-bg: #fdf1d3;
  --estimated-fg: #7a4b00;
  --actual-bg: #dcefe6;
  --actual-fg: #14532d;
  --stop-bg: #fdf1d3;
  --error-bg: #fbe3e1;
  --error-fg: #8f1d15;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
:focus-visible { outline: 3px solid #e09f3e; outline-offset: 2px; }

.masthead {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  padding: 12px max(20px, calc((100vw - 1180px) / 2));
  background: var(--brand);
  color: #fff;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
  text-decoration: none;
}
.brand:hover { color: #fff; }
.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--gold) url("favicon.svg") center / cover;
}
.masthead nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.masthead nav a { color: #ece6f5; text-decoration: none; font-size: 0.95rem; }
.masthead nav a:hover { color: #fff; text-decoration: underline; }

main { max-width: 1180px; margin: 0 auto; padding: 0 20px 48px; }

main > section {
  margin-top: 28px;
  padding: 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  scroll-margin-top: 70px;
}

.hero { background: transparent; border: 0; padding: 36px 4px 4px; }
.hero h1 { margin: 0 0 14px; max-width: 22em; font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1.15; letter-spacing: -0.01em; }
.lede { max-width: 46em; margin: 0 0 12px; font-size: 1.1rem; }
.snapshot { display: inline-block; margin: 0; padding: 6px 12px; border-radius: 999px; background: #e9e3f1; color: var(--brand-dark); font-size: 0.92rem; }

h2 { margin: 0 0 8px; font-size: 1.45rem; line-height: 1.2; }
h3 { margin: 20px 0 8px; font-size: 1.05rem; }
section > p { max-width: 62em; }

.muted { color: var(--muted); font-size: 0.9rem; }
.block { display: block; }
.number { text-align: right; font-variant-numeric: tabular-nums; }
.count { margin: 12px 0 8px; color: var(--muted); font-size: 0.92rem; }

.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 16px; margin-top: 16px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 0.88rem; font-weight: 600; color: var(--muted); }
.filters label.inline { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; color: var(--ink); padding-bottom: 8px; }
.filters input[type="search"], .filters input[type="date"], .filters select {
  min-width: 190px;
  padding: 8px 10px;
  border: 1px solid #b8c4c0;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.filters fieldset { margin: 0; padding: 0; border: 0; display: flex; gap: 14px; align-items: center; }
.filters legend { padding: 0; font-size: 0.88rem; font-weight: 600; color: var(--muted); }

button.plain {
  margin-top: 12px;
  padding: 7px 14px;
  border: 1px solid #b8c4c0;
  border-radius: 8px;
  background: #fff;
  color: var(--brand-dark);
  font: inherit;
  cursor: pointer;
}
button.plain:hover { background: #eef3f1; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { background: #eef3f1; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); white-space: nowrap; }
th.number, td.number { text-align: right; }
tbody tr:last-child td { border-bottom: 0; }
td:first-child { white-space: nowrap; }
td .date { font-weight: 600; margin-right: 6px; }

.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; background: #e7ecea; color: var(--muted); }
.chip-estimated { background: var(--estimated-bg); color: var(--estimated-fg); }
.chip-actual { background: var(--actual-bg); color: var(--actual-fg); }
.chip-priority { background: #dfe9f7; color: #1e3a6b; }

.clock { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 1.4fr); gap: 24px; align-items: start; }
.clock .filters { flex-direction: column; align-items: stretch; }
.clock-result { padding: 16px 20px; border-left: 4px solid var(--brand); border-radius: 0 10px 10px 0; background: #f1f6f5; }
.clock-date { margin: 0 0 8px; font-size: 1.15rem; }
.clock-date strong { font-size: 1.35rem; }
.steps, .caveats { margin: 8px 0; padding-left: 22px; }
.caveats { color: var(--muted); font-size: 0.92rem; }
.refusal { color: var(--error-fg); font-weight: 600; }

.reference details { border-top: 1px solid var(--line); padding: 10px 2px; }
.reference details:last-child { border-bottom: 1px solid var(--line); }
.reference summary { cursor: pointer; font-weight: 600; }
.reference details p { margin: 8px 0; }

.files code, #network-url { padding: 1px 6px; border-radius: 5px; background: #eef3f1; font-size: 0.92em; overflow-wrap: anywhere; }

footer { max-width: 1180px; margin: 0 auto; padding: 8px 24px 40px; color: var(--muted); font-size: 0.88rem; }

/* What the assistant did. */
.tryit ul { margin: 6px 0 0; padding-left: 20px; color: var(--muted); font-size: 0.95rem; }
.activity { margin-top: 24px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfb; }
.activity-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.activity-head h3 { margin: 0; }
.activity-head button { margin: 0 0 0 auto; padding: 3px 10px; font-size: 0.85rem; }
.activity > p { margin: 6px 0 10px; }
#activity-list { margin: 0; padding: 0; list-style: none; max-height: 320px; overflow: auto; font-size: 0.88rem; }
#activity-list:empty::before { content: "Send a message to see each step here."; color: var(--muted); }
#activity-list li { display: grid; grid-template-columns: 68px 72px minmax(0, 1fr); gap: 8px; padding: 5px 8px; border-top: 1px solid #edf0ee; overflow-wrap: anywhere; }
#activity-list time { color: var(--muted); font-variant-numeric: tabular-nums; }
.activity-kind { font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.activity-contact .activity-kind { color: #1e3a6b; }
.activity-stop { background: var(--stop-bg); }
.activity-stop .activity-kind { color: var(--estimated-fg); }
.activity-error { background: var(--error-bg); }
.activity-error .activity-kind { color: var(--error-fg); }

.assistant-note { padding: 10px 14px; border-radius: 8px; background: #eef3f1; font-size: 0.93rem; }
#assistant-status { color: var(--muted); font-size: 0.93rem; }
#assistant-status.assistant-failed { padding: 10px 14px; border-radius: 8px; background: var(--error-bg); color: var(--error-fg); font-weight: 600; }

/* The rules below this line are derived from templates/assistant.css of the
   agentify-website skill in https://github.com/cognizant-ai-labs/agentic-web
   (Apache License 2.0), with this site's colors. See NOTICE.md. */

/* 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 {
  --ns-font: system-ui, sans-serif;
  --ns-bg: #ffffff;
  --ns-fg: #17252a;
  --ns-primary: #5b3a8c;
  --ns-accent: #5b3a8c;
  --ns-border: #d6ddd9;
  --ns-panelbg: #ffffff;
  --ns-msgbg: #f1f5f3;
  --ns-muted: #55676d;
}

.assistant-panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  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; }
#agent-app .ns-chat { background: var(--ns-bg); border: 1px solid var(--ns-border); border-radius: 10px; }

/* Undo page-wide form rules that would reach the runtime's own controls. */
#agent-app input[type="checkbox"],
#agent-app input[type="radio"] { width: auto; }
#agent-app .ns-header { flex-wrap: wrap; }
#agent-app .ns-settings-body label { margin: 4px 0; font-weight: 400; }
#agent-app .ns-w-label { font-family: inherit; }
#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; }
#agent-app .ns-w-toggle { font-size: 13px; }
#agent-app button { margin: 0; }
#agent-app .ns-w-choice { color: var(--ns-fg); }
#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 consent card's own background. */
#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-msg { overflow-wrap: break-word; }
#agent-app .ns-consent-actions { flex-wrap: wrap; }
#agent-app .ns-consent-actions button { white-space: nowrap; }

/* The runtime adds its confirmation dialog to <body>, outside #agent-app. */
body > dialog h2 { margin: 0 0 12px; font: 700 1.25em system-ui, sans-serif; }
body > dialog button { margin-right: 8px; }

@media (max-width: 760px) {
  main > section { padding: 20px 16px; }
  .assistant-panels { grid-template-columns: 1fr; }
  .clock { grid-template-columns: 1fr; }
  #activity-list li { grid-template-columns: 60px minmax(0, 1fr); }
  #activity-list .activity-kind { display: none; }
  .filters input[type="search"], .filters input[type="date"], .filters select { min-width: 0; width: 100%; }
  .filters label { flex: 1 1 100%; }
}

/* Glossary cards. */
.terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.term { padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: #fcfbfd; }
.term h3 { margin: 0 0 6px; color: var(--brand-dark); }
.term p { margin: 6px 0; font-size: 0.95rem; }
