/* The two MCP server pages: imis-mcp-server.html and mcp-server.html share this file.
   Page-only rules, tokens only, .pg-imis- prefix (the iMIS page came first). */

/* Action and tool names are code. They take the system monospace stack at the size of
   the text around them; the page keeps Figtree for everything that is prose. */
.pg-imis-calls code, .pg-imis-qa code, .table code, .pg-imis-rule code, .pg-imis-step code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.95em; }
.pg-imis-calls { gap: var(--sp-2); }

/* The person's request to their agent: the UI size in ink at semibold, so it reads as
   someone speaking rather than as body copy (the mcp-server.css pattern). */
.pg-imis-prompt { margin: 0; font-size: var(--fs-ui); font-weight: var(--fw-semibold); line-height: var(--lh-snug); color: var(--fg-1); }

/* -- Hero diagram: four assistants, Certant in the middle, iMIS underneath ---------- */

/* The request is the diagram's headline, so it is larger than a session prompt and
   holds two lines of height: the text changes with each assistant and must not make
   the panel jump. */
.pg-imis-hero__ask { font-size: var(--fs-h4); min-height: 2.6em; }

/* Four equal cells with no gap, so each mark's centre sits at an eighth, three eighths,
   five eighths and seven eighths of the width, which is where the wires start. */
.pg-imis-hero__ais { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pg-imis-ai { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); text-align: center; }
.pg-imis-ai__mark { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--paper); color: var(--fg-1); transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.pg-imis-ai__mark svg { width: 26px; height: 24px; fill: currentColor; }
/* An assistant with no mark of its own takes a Lucide line icon, which is drawn, not filled. */
.pg-imis-ai__mark svg.lucide { fill: none; }
/* "Microsoft 365 Copilot" takes two lines; every name holds two so the wires start level. */
.pg-imis-ai__name { min-height: 2.6em; font-size: var(--fs-micro); font-weight: var(--fw-semibold); color: var(--fg-2); line-height: var(--lh-snug); transition: color var(--dur) var(--ease); }
/* The assistant that is speaking takes Certant's teal, the same colour as the hub it is
   talking to, so the eye joins the two. */
.pg-imis-ai.is-on .pg-imis-ai__mark { background: var(--teal); color: var(--on-solid); }
.pg-imis-ai.is-on .pg-imis-ai__name { color: var(--teal-text); }

/* The wires. Resting wires are paper on the teal tint; the live wire is drawn over its
   resting twin in teal. pathLength="1" on the live paths makes the dash maths the same
   for every curve. */
.pg-imis-wires { display: block; width: 100%; height: auto; margin-top: var(--sp-1); }
.pg-imis-wires--down { margin-top: 0; }
.pg-imis-wire { fill: none; stroke: var(--paper); stroke-width: 2; stroke-linecap: round; }
.pg-imis-wire--live { stroke: var(--teal); stroke-width: 2.5; stroke-dasharray: 1; stroke-dashoffset: 1; }
.pg-imis-wire--live.is-drawn { stroke-dashoffset: 0; }

/* Certant is the centre of the drawing: the one saturated block, wider than any mark
   above it, carrying the logo and one line on what it does. */
.pg-imis-hub { --pad: var(--sp-4) var(--sp-5); display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); width: fit-content; max-width: 100%; margin-inline: auto; text-align: center; }
.pg-imis-hub img { height: 30px; width: auto; }
.pg-imis-hub__name { font-size: var(--fs-ui); font-weight: var(--fw-bold); color: var(--on-solid); }
.pg-imis-hub__sub { font-size: var(--fs-sm); color: var(--on-solid-muted); line-height: var(--lh-snug); }

/* What happened in iMIS: one row per action, a green tick, the plain words and the
   action's name. */
.pg-imis-hero__imis { --pad: var(--sp-4) var(--sp-5); }
.pg-imis-step { display: flex; align-items: center; gap: var(--sp-3); padding-block: var(--sp-2); font-size: var(--fs-sm); color: var(--fg-1); }
.pg-imis-step .tile { width: 28px; height: 28px; background: var(--green-tint); color: var(--green-text); }
.pg-imis-step .tile svg { width: 14px; height: 14px; }
/* The words above, the action's name beneath, so a long action name never squeezes the
   words and every turn of the animation has rows of the same height. */
.pg-imis-step__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; min-height: 40px; justify-content: center; }
.pg-imis-step__text { font-weight: var(--fw-medium); line-height: var(--lh-snug); }
.pg-imis-step code { color: var(--fg-2); overflow-wrap: anywhere; }
/* A row the animation has not reached yet. */
.pg-imis-step.is-pending { opacity: 0; }
@media (max-width: 600px) {
  .pg-imis-ai__mark { width: 48px; height: 48px; }
  /* "Microsoft 365 Copilot" takes three lines in a phone-width cell. */
  .pg-imis-ai__name { min-height: 3.9em; }
  /* On a phone the words wrap to two lines; the action's name goes so each turn of the
     animation keeps the panel the same height. */
  .pg-imis-step code { display: none; }
}

/* -- Approval card ------------------------------------------------------------------ */

/* Rows inside the approval card (the mcp-server.css pattern): name the cloud ground and
   the row padding, since --_bg and --pad are inherited from the paper card. */
.pg-imis-rule > .tint:not([class*="tint--"]) { --_bg: var(--bg-tint); --pad: 12px 16px; font-size: var(--fs-sm); color: var(--fg-2); }
.pg-imis-rule > .tint b { color: var(--fg-1); }

/* -- Coverage map ------------------------------------------------------------------- */

/* The twelve areas of iMIS as one compact grid: an icon, the area's name and how many
   actions it has. Each is a link that opens the finder on that area, so the detail
   lives in one place (the finder) and this block stays a map. */
.pg-imis-areas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2) var(--sp-6); }
.pg-imis-area-link { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3); margin-inline: calc(-1 * var(--sp-3)); border-radius: var(--r-card); color: var(--fg-1); transition: background var(--dur) var(--ease); }
/* The page's teal is spent on the hero and the approval card, so the map stays neutral:
   a cloud tile with the icon in teal, and a cloud ground on hover. */
.pg-imis-area-link:hover { background: var(--bg-tint); color: var(--fg-1); }
.pg-imis-area-link .tile { background: var(--bg-tint); color: var(--teal-text); }
.pg-imis-area-link:hover .tile { background: var(--paper); }
.pg-imis-area-link__body { display: flex; flex-direction: column; min-width: 0; line-height: var(--lh-snug); }
.pg-imis-area-link__body b { font-weight: var(--fw-semibold); }
.pg-imis-area-link__body span { font-size: var(--fs-sm); color: var(--fg-2); font-variant-numeric: tabular-nums; }
/* The Certant MCP server page says what each part is for in a sentence and has no finder
   to link into, so its items are not links: top-aligned, no hover ground, more room
   between rows. They sit on a band, so the tile is paper. */
.pg-imis-areas--told { gap: var(--sp-6); }
.pg-imis-part { display: flex; align-items: flex-start; gap: var(--sp-3); }
.pg-imis-part .tile { flex-shrink: 0; background: var(--paper); color: var(--teal-text); }
.pg-imis-part__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pg-imis-part__body b { font-weight: var(--fw-semibold); color: var(--fg-1); line-height: var(--lh-snug); }
.pg-imis-part__count { font-size: var(--fs-micro); color: var(--fg-3); font-variant-numeric: tabular-nums; }
.pg-imis-part__what { margin-top: 4px; font-size: var(--fs-sm); color: var(--fg-2); line-height: var(--lh-normal); }
@media (max-width: 900px) { .pg-imis-areas { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .pg-imis-areas { grid-template-columns: 1fr; } }

/* -- Questions an engineer asks ------------------------------------------------------ */

/* Six questions, each answered in a sentence or two, bare on the page. The question is
   the heading; the facts an engineer scans for are in ink inside the answer, so nothing
   needs an icon or a chip to be found. */
.pg-imis-qa { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-7) var(--sp-6); margin-bottom: 0; }
.pg-imis-qa dt { font-size: var(--fs-h4); font-weight: var(--fw-bold); line-height: var(--lh-snug); color: var(--fg-1); }
.pg-imis-qa dd { margin: var(--sp-2) 0 0; color: var(--fg-2); }
.pg-imis-qa dd b { font-weight: var(--fw-semibold); color: var(--fg-1); }
@media (max-width: 1100px) { .pg-imis-qa { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .pg-imis-qa { grid-template-columns: 1fr; gap: var(--sp-6); } }

/* -- What the server does about a risky request ------------------------------------- */

/* What the agent tries on the left in ink, what the server does about it on the right.
   The table sits bare on the page at a readable width, and the left column is set a step
   larger so the list can be scanned by risk. */
.pg-imis-guards { max-width: 1000px; }
.pg-imis-guards tbody th { width: 34%; padding-left: 0; font-size: var(--fs-ui); font-weight: var(--fw-bold); }
.pg-imis-guards thead th:first-child { padding-left: 0; }
.pg-imis-guards td { font-size: var(--fs-ui); color: var(--fg-2); line-height: var(--lh-normal); }
/* flat.css sets a table's last column to the right for figures; this one is a sentence. */
.pg-imis-guards th:last-child, .pg-imis-guards td:last-child { text-align: left; }
/* Stacked on a phone, each answer sits under its own risk, so the column name is not
   repeated above every one. */
@media (max-width: 800px) { .pg-imis-guards tbody th { width: auto; } .pg-imis-guards td[data-label]::before { content: none; } }

/* -- Action finder ------------------------------------------------------------------ */

/* The finder's controls: the search field takes the room, the area list keeps a
   readable width, and the two stack on a phone. */
.pg-imis-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); gap: var(--sp-4); align-items: end; }
@media (max-width: 700px) { .pg-imis-controls { grid-template-columns: 1fr; } }

/* A native select wearing .input needs its own arrow room and a pointer. */
select.input { cursor: pointer; padding-right: var(--sp-6); }

/* The kind-of-action pills carry an icon and a count beside the word. */
.pg-imis-types .tab { display: inline-flex; align-items: center; gap: 6px; }
.pg-imis-types .tab span { font-variant-numeric: tabular-nums; opacity: 0.7; }

/* The result count sits on the page between the filters and the table. */
.pg-imis-count { font-size: var(--fs-sm); color: var(--fg-2); font-variant-numeric: tabular-nums; }

/* 206 rows would run the page to several screens, so the table scrolls inside its own
   box on the white page, and the column heads stay put while it does. */
.pg-imis-results { max-height: 660px; overflow-y: auto; border-bottom: 1px solid var(--line); }
.pg-imis-results thead th { position: sticky; top: 0; z-index: 1; background: var(--bg-page); }

/* The leading tile says what kind of action a row is, in that kind's hue: blue reads,
   green creates, teal updates and runs, claret deletes. The same hue is on the chip at
   the end of the row, so the colour is never the only signal. */
.pg-imis-kind { width: 1%; padding-right: 0; }
.pg-imis-kind .tile { background: var(--blue-tint); color: var(--blue-text); }
tr[data-type="create"] .pg-imis-kind .tile { background: var(--green-tint); color: var(--green-text); }
tr[data-type="update"] .pg-imis-kind .tile, tr[data-type="run"] .pg-imis-kind .tile { background: var(--teal-tint); color: var(--teal-text); }
tr[data-type="delete"] .pg-imis-kind .tile { background: var(--pink-tint); color: var(--pink-text); }

/* Under each action's name: which part of iMIS it belongs to, and a note where the
   action has a condition. Regular weight so the name still leads. */
.pg-imis-area, .pg-imis-note { display: block; margin-top: 2px; font-size: var(--fs-micro); font-weight: var(--fw-regular); color: var(--fg-3); line-height: var(--lh-normal); }
.pg-imis-note { font-size: var(--fs-sm); color: var(--fg-2); margin-top: var(--sp-1); }

/* The action column is code and must never push the table wider than a phone. */
.pg-imis-results td code { white-space: nowrap; }
.pg-imis-results td:last-child { white-space: nowrap; }
.pg-imis-results .cluster { gap: var(--sp-1); }
/* On a phone each row stacks. The tile column goes (the chip carries the same icon),
   the action and type need no column name above them, and the code may wrap. */
@media (max-width: 700px) {
  .pg-imis-results .pg-imis-kind { display: none; }
  .pg-imis-results td code { white-space: normal; overflow-wrap: anywhere; }
  .pg-imis-results td:last-child { white-space: normal; }
  .pg-imis-results td[data-label]::before { content: none; }
  .pg-imis-results tr { padding: var(--sp-3) 0; }
  .pg-imis-results .table--stack tbody th, .pg-imis-results td { padding: 3px 0; }
}

/* Shown when a search matches nothing. */
.pg-imis-empty { padding: var(--sp-6) 0 var(--sp-4); font-size: var(--fs-sm); color: var(--fg-2); }

/* -- Other sections ----------------------------------------------------------------- */

/* The recording of the reference workflow is the section's figure: the full column
   wide, on the panel radius, with an ink ground while the poster loads. */
.pg-imis-film { display: block; width: 100%; height: auto; border-radius: var(--r-panel); background: var(--ink); }

/* The four parts of the recording, in order. Each is a button that jumps the recording
   to that part, and the part that is playing takes the cloud ground (its callout turns
   bronze through flat.css's linked-pair rule). */
.pg-imis-chapters { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-2); }
.pg-imis-chapter { display: flex; align-items: flex-start; gap: var(--sp-3); width: 100%; height: 100%; padding: var(--sp-3); border: 0; border-radius: var(--r-card); background: none; font: inherit; font-size: var(--fs-sm); line-height: var(--lh-normal); text-align: left; color: var(--fg-2); cursor: pointer; transition: background var(--dur) var(--ease); }
.pg-imis-chapter b { display: block; font-size: var(--fs-ui); color: var(--fg-1); }
.pg-imis-chapter .callout { flex-shrink: 0; margin-top: 1px; }
.pg-imis-chapter:hover, .pg-imis-chapter.is-hot { background: var(--bg-tint); }
@media (max-width: 1000px) { .pg-imis-chapters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .pg-imis-chapters { grid-template-columns: 1fr; } }

/* A shell command on the ink panel. Monospace, scrolls sideways inside its own box on a
   phone so the page never does. */
.pg-imis-code { margin: 0; overflow-x: auto; font: 400 var(--fs-sm)/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--fg-1); }

/* Long chips wrap inside a phone column. */
.answer__cites .chip { white-space: normal; line-height: 1.35; }

/* -- On a phone ---------------------------------------------------------------------- */

@media (max-width: 700px) {
  /* A roomy stacking table keeps its 14px cell padding when it stacks, which leaves the
     answer adrift of its own heading. Stacked, the row's padding does the spacing. */
  .pg-imis-guards.table--stack tbody th { padding: 0 0 var(--sp-1); }
  .pg-imis-guards.table--stack td { padding: 0; }
}
@media (max-width: 600px) {
  /* A panel's 32px padding, twice over for a card inside a panel, leaves the words a
     column about 220px wide. At phone width a panel takes the page's own gutter. */
  :where(main) .tint--panel { --pad: var(--page-pad); }
  /* A bare row has no ground, so its side padding is only an indent, and a tile centred
     on six lines of text floats. The tile sits at the top, flush with the column. */
  .hue-row--bare { align-items: flex-start; gap: var(--sp-3); padding: var(--sp-3) 0; }
  /* Code wraps inside its box; scrolling sideways hid the end of every long line. */
  .pg-imis-code { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-micro); }
}
@media (max-width: 359px) {
  /* On the narrowest phones the request and a step's words run to three lines on some
     turns. Both hold three, so the panel, and the page under it, keeps one height as the
     turns change. */
  .pg-imis-hero__ask { min-height: 3.9em; }
  .pg-imis-step__body { min-height: 58px; }
}
