/* The figures' shared stylesheet: the same block every fragment embeds in <style data-page data-dgm>. One copy per page. */
/* dgm: the figures the diagram agent drew (stage 5). One copy per page. Values from NexQloud Health's .flow-dg and its
   motion (v4.css 68 to 135) and Duty Recovery AI's .arch; tokens only. Prefix dgm- so nothing collides with the design system. */
.dgm{position:relative;container-type:inline-size;min-width:0;margin:0}
.dgm.card{padding:var(--sp-3)}
.dgm-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 16px;margin-bottom:var(--sp-3)}
.dgm-head > p{max-width:62em;font:400 var(--t-label)/1.5 var(--font-sans);color:var(--ink)}
.dgm-head > .dgm-st{margin-left:auto}
/* a node: Health's .dg-node (white, a 1.5px ink stroke, 12px corners); .is-on is the node the flow ends on (tint-soft, the accent stroke) */
.dgm-node{position:relative;min-width:0;padding:14px 16px;border:1.5px solid var(--ink);border-radius:12px;background:var(--paper);color:var(--ink);text-wrap:pretty}
/* a plain node in a flow: Health's 76px node, its words centred (.dg-c); a numbered node and a tile keep their words at the left */
.dgm-flow .dgm-node:not(.is-num):not(.is-tile){display:grid;align-content:center;min-height:76px;text-align:center}
.dgm-flow .dgm-node.is-num{display:grid;align-content:center;min-height:76px}
.dgm-node.is-on{background:var(--tint-soft);border-color:var(--vital-ink)}
.dgm-node.is-in{background:var(--tint-soft);border-color:var(--vital-ink)}
.dgm-t{font:500 15px/1.3 var(--font-sans);letter-spacing:-.005em;color:var(--ink)}          /* Health .dg-l */
.dgm-t a{color:var(--vital-ink);font-weight:500;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:.24em;text-decoration-color:color-mix(in srgb,currentColor 40%,transparent)}
.dgm-t a:hover{text-decoration-color:currentColor}
.dgm-t a:focus-visible{outline:2px solid var(--vital-ink);outline-offset:2px;border-radius:2px}
.dgm-s{margin-top:4px;font:400 12.5px/1.45 var(--font-sans);color:var(--muted)}             /* Health .dg-s */
.dgm-node.is-on .dgm-s{color:var(--ink)}
.dgm-note{margin-top:8px;padding-top:8px;border-top:1px solid var(--line);font:400 12.5px/1.45 var(--font-sans);color:var(--muted)}   /* DRAI .arch-notes */
.dgm-k{display:block;font:500 var(--t-fine)/1.45 var(--font-mono);letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}  /* DRAI .arch-k */
.dgm-k + .dgm-t{margin-top:4px}
/* a numbered node: the step marker (the engine's .step-n at 28px) before the title */
.dgm-node.is-num{padding-left:56px}
.dgm-n{position:absolute;left:14px;top:12px;display:grid;place-items:center;width:28px;height:28px;border:1px solid var(--vital-ink);border-radius:var(--r-pill);background:linear-gradient(180deg,#ffffff 0%,#eef0ff 100%);box-shadow:inset 0 1px 0 #fff,0 4px 10px -6px rgba(var(--vital-ink-rgb),.35);font:500 12px/1 var(--font-mono);color:var(--vital-ink)}
/* arrows: Health's .dg-line (the accent, 1.5px) and .dg-arrow (an 8 by 10 head), drawn as SVG lines with a marker, so one piece serves
   both directions; the label over an arrow is Health's .dg-m (mono, 11px, upper case) */
.dgm-defs{position:absolute;width:0;height:0;overflow:hidden}
.dgm-ar{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;align-self:stretch;min-width:0}
.dgm-ar svg{display:block;overflow:visible;flex:none}
.dgm-ar .is-h{width:100%;height:12px}
.dgm-ar .is-v{display:none;width:12px;height:36px}
.dgm-ln{stroke:var(--vital-ink);stroke-width:1.5;fill:none}
.dgm-ah{fill:var(--vital-ink)}
.dgm-m{font:500 11px/1.35 var(--font-mono);letter-spacing:.08em;text-transform:uppercase;color:var(--muted);text-align:center;text-wrap:balance}
/* a flow: nodes in a row, an arrow between each pair; one column under 720px of the figure's width (Health's switch), the arrows turned */
.dgm-flow{display:grid;align-items:center;column-gap:0}
.dgm-flow > .dgm-ar{padding:0 2px}
.dgm-flow.is-top{align-items:start}
.dgm-flow.is-top > .dgm-ar{align-self:start;justify-content:flex-start;padding-top:20px}   /* the arrow at the step markers' level */
@container (max-width:720px){
  .dgm-flow:not(.is-600){max-width:420px;margin-inline:auto}   /* each figure sets its own column template for the stack */
  .dgm-flow:not(.is-600) > .dgm-ar{flex-direction:row;gap:10px;padding:4px 0;justify-content:flex-start;padding-left:28px}
  .dgm-flow:not(.is-600) > .dgm-ar .is-v{order:-1}
  .dgm-flow:not(.is-600) .dgm-ar .is-h{display:none}
  .dgm-flow:not(.is-600) .dgm-ar .is-v{display:block}
  .dgm-flow:not(.is-600) .dgm-m{text-align:left}
}
@container (max-width:600px){   /* a figure that shares its row with a panel turns later */
  .dgm-flow.is-600{max-width:420px;margin-inline:auto}
  .dgm-flow.is-600 > .dgm-ar{flex-direction:row;gap:10px;padding:4px 0;justify-content:flex-start;padding-left:28px}
  .dgm-flow.is-600 > .dgm-ar .is-v{order:-1}
  .dgm-flow.is-600 .dgm-ar .is-h{display:none}
  .dgm-flow.is-600 .dgm-ar .is-v{display:block}
  .dgm-flow.is-600 .dgm-m{text-align:left}
}
/* the output link under the last node */
.dgm-out{margin-top:10px}
/* chips: the table system's status chips (.tag.tone-green with a check for OK, .tone-amber with a dot for attention), allowed to wrap */
.dgm-st{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.dgm-st .tag{flex:0 1 auto;min-width:0;max-width:100%;min-height:26px;padding:3px 10px;font-size:13px;line-height:1.3;white-space:normal;text-align:left}
.dgm-st .tag .i{width:13px;height:13px}
.dgm-st .tag .fn-sup{margin-left:2px}
/* the figure's foot: a note on the left, the control on the right (Health's .hc.has-tg: caption, then the button) */
.dgm-foot{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;column-gap:10px;margin-top:var(--sp-3)}
.dgm-foot > p{max-width:62em;font:400 var(--t-label)/1.5 var(--font-sans);color:var(--ink)}
.dgm-foot > p:empty{display:none}
.dgm-foot .dgm-tg{grid-column:2;margin-top:0}
.dgm-foot + .dg-desc,.dgm-flow + .dg-desc,.dgm-grid + .dg-desc{margin-top:var(--sp-2)}
/* the text description for screen readers: the engine's details.dg-desc; a paragraph, as on Health */
.dgm .dg-desc p{max-width:44em;margin-top:4px;font-size:var(--t-label);line-height:1.55;color:var(--muted)}
/* the moving steps (How a sealed request travels): the engine's .steps with Health's motion (v4.css 93 to 105). The script adds
   .is-anim; each number lights in turn and its line runs to the next; after three runs it rests on the still picture */
.dgm-steps{--gap:var(--sp-4)}
.dgm-steps.is-6{--n:6}.dgm-steps.is-4{--n:4}
@media (max-width:980px){.dgm-steps.is-6,.dgm-steps.is-4{--n:1}}
.dgm-steps .step:not(:last-child)::before{background:var(--control-line)}   /* the still connector at 3:1 */
.dgm-steps .step-n{transition:box-shadow .45s var(--ease),color .45s var(--ease),border-color .45s var(--ease)}
.dgm-steps .step h3{transition:color .45s var(--ease)}   /* the engine's sizes, as on Health */
.dgm-steps.is-anim .step:not(:last-child)::after{content:"";position:absolute;z-index:0;top:17px;left:44px;right:calc(8px - var(--gap));height:2px;border-radius:2px;background:var(--vital-ink);transform:scaleX(0);transform-origin:0 50%;transition:transform 1.25s cubic-bezier(.45,0,.25,1)}
.dgm-steps.is-anim .step.is-now::after,.dgm-steps.is-anim .step.is-done::after{transform:scaleX(1)}
.dgm-steps.is-anim .step.is-now .step-n{border-color:var(--vital-ink);color:#fff;box-shadow:inset 0 0 0 18px var(--vital-ink),0 0 0 6px rgba(60,69,212,.13),0 8px 18px -8px rgba(60,69,212,.75)}
.dgm-steps.is-anim .step.is-done .step-n{border-color:var(--vital-ink);color:var(--vital-ink);box-shadow:inset 0 0 0 18px var(--tint-mid),0 0 0 0 rgba(60,69,212,0),0 4px 10px -6px rgba(60,69,212,.35)}
.dgm-steps.is-anim .step.is-now h3{color:var(--vital-ink)}
@media (max-width:980px){
  .dgm-steps.is-anim .step:not(:last-child)::after{top:44px;left:17px;right:auto;bottom:calc(8px - var(--sp-3));width:2px;height:auto;transform:scaleY(0);transform-origin:50% 0}
  .dgm-steps.is-anim .step.is-now::after,.dgm-steps.is-anim .step.is-done::after{transform:scaleY(1)}
}
.dgm .no-tr,.dgm .no-tr *{transition:none!important}
/* the button beside a moving figure: Health's .anim-tg (32px, round, pause, play or replay) */
.dgm-tg{display:inline-grid;place-items:center;flex:none;width:32px;height:32px;padding:0;border:0;border-radius:50%;cursor:pointer;color:var(--ink);background:var(--paper);box-shadow:inset 0 0 0 1px var(--field-line),0 1px 2px rgba(0,0,0,.05);transition:background .2s var(--ease),box-shadow .2s var(--ease)}
.dgm-tg svg{width:14px;height:14px;fill:currentColor}
.dgm-tg[data-k="again"] svg{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.dgm-tg:hover{background:var(--tint-soft);box-shadow:inset 0 0 0 1px var(--vital-ink)}
.dgm-tg:focus-visible{outline:2px solid var(--vital-ink);outline-offset:2px}
/* a grid of tiles (the seven steps of a check; the three states of data) */
.dgm-grid{display:grid;grid-template-columns:repeat(var(--n,3),minmax(0,1fr));gap:12px}
@container (max-width:860px){.dgm-grid.is-4{grid-template-columns:repeat(2,minmax(0,1fr))}}
@container (max-width:720px){.dgm-grid,.dgm-grid.is-4{grid-template-columns:minmax(0,1fr)}}
.dgm-grid .dgm-node{display:flex;flex-direction:column;gap:0}
.dgm-grid .dgm-st{margin-top:auto;padding-top:12px}
.dgm-grid .ic-disc{margin-bottom:12px}
.dgm-grid .dgm-out{margin-top:auto;padding-top:8px}
.dgm-line{margin-top:var(--sp-2);font:400 var(--t-body)/1.5 var(--font-sans);color:var(--ink);max-width:62em}
/* a group that holds nodes (Sovereign's two groups; the four bindings): DRAI's .arch-box */
.dgm-group{position:relative;min-width:0;padding:14px 16px 16px;border:1.5px solid var(--ink);border-radius:12px;background:var(--paper)}
.dgm-group > .dgm-k{margin-bottom:10px;color:var(--ink)}
/* the control-plane band over Sovereign's groups and the bands under Home's tiles: a bar in the accent, ink words */
.dgm-band{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:4px 12px;min-height:44px;padding:9px 14px;border:1.5px solid var(--vital-ink);border-radius:10px;background:var(--tint-soft);color:var(--ink);text-align:center;font:500 14px/1.35 var(--font-sans)}
.dgm-band .link{font-weight:500}
.dgm-band.is-plane{justify-content:flex-start;text-align:left;gap:4px 14px;padding:12px 16px}
.dgm-band.is-plane .dgm-k{color:var(--vital-ink);flex:none}
.dgm-band.is-plane > span:last-child{font:400 var(--t-label)/1.5 var(--font-sans);color:var(--ink)}
@media (prefers-reduced-motion:reduce){.dgm *{transition:none!important;animation:none!important}}
