/* Diagnosis loop at the top of diagnosis.html, after the earlier homepage loop (home-diagnostics.*):
   a pixel robot -> evaluate -> diagnosis card (the centre) -> what helps, by architecture -> improve and evaluate again. */
.dl { --dl-ink: #203749; --dl-muted: #5c6d76; --dl-rule: #d9ddd5; --dl-surface: #f5f7f7;
  --dl-mind: #49796b; --dl-act: #446f86; --dl-mind2act: #91793d; --dl-focus: var(--dl-act);
  --dl-e2e: #3f8a6a; --dl-hybrid: #8a6fb0; --dl-agent: #4f7cae; --dl-lane: var(--dl-e2e);
  margin-top: 30px; color: var(--dl-ink); }
.dl-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dl p { margin: 0; line-height: 1.35; }
.dl-figure { position: relative; padding: 4px 0 64px; }
.dl-wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.dl-path { fill: none; stroke: #c9d3d1; stroke-width: 1.5; stroke-dasharray: 3 5; }
.dl-path--return { stroke: color-mix(in srgb, var(--dl-lane) 60%, #d6dcda); stroke-dasharray: 8 6; transition: stroke .4s; }
.dl-steps .dl-node.dl-node--help { border: 1.5px dashed #a9b8b4; }
.dl-now { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; background: color-mix(in srgb, var(--dl-mind) 14%, #fff); color: var(--dl-mind); font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: none; vertical-align: 1px; }
.dl-ongoing { display: inline-block; margin-left: 6px; padding: 0 7px; border: 1px dashed #b9c5c2; border-radius: 999px; color: var(--dl-muted); font-size: 10.5px; font-weight: 650; letter-spacing: .04em; text-transform: none; vertical-align: 1px; }
.dl-tokens circle { fill: var(--dl-ink); }
.dl-tokens rect { fill: var(--dl-lane); }
.dl-steps { position: relative; display: grid; grid-template-columns: 1fr .95fr 1.45fr 1.15fr; gap: 26px; align-items: stretch; margin: 0; padding: 0; list-style: none; }
.dl-node { position: relative; box-sizing: border-box; display: flex; flex-direction: column; padding: 16px 18px; border: 1px solid var(--dl-rule); border-radius: 12px; background: #fff; transition: border-color .35s, box-shadow .35s; }
.dl-node.is-active { border-color: color-mix(in srgb, var(--dl-focus) 60%, #fff); box-shadow: 0 6px 22px #20374914; }
.dl-step { font-size: 11.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--dl-muted); }
.dl-title { margin-top: 4px !important; font-size: 16px; font-weight: 650; }
.dl-desc { margin-top: auto !important; padding-top: 12px; font-size: 12.5px; color: var(--dl-muted); }

/* Model: a small robot avatar beside the name; the ability bars and the round log carry the story.
   The robot keeps one size; progress shows in the bars, the chest lights and the log. */
.dl-node--model { background: var(--dl-surface); }
.dl-who { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 12px; align-items: center; }
.dl-robot { width: 44px; height: 44px; border-radius: 10px; background: #e9efee; overflow: hidden; }
.dl-robot svg { display: block; width: 44px; height: 44px; image-rendering: pixelated; transform: scale(.86); transform-origin: 50% 100%; }
.dl-robot .dl-light { fill: #c9d3d1; transition: fill .3s; }
.dl-robot .dl-light.is-on { fill: var(--dl-lane); }
.dl-who-text { display: grid; gap: 2px; min-width: 0; }
.dl-node--model .dl-title { margin: 0 !important; }
.dl-round { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 12px; font-weight: 600; color: var(--dl-muted); }
.dl-arch { display: inline-block; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--dl-lane) 14%, #fff); color: var(--dl-lane); font-size: 11.5px; font-weight: 650; letter-spacing: .02em; transition: background .3s, color .3s; }
.dl-skills { display: grid; gap: 11px; margin: 18px 0 0; padding: 14px 0 0; border-top: 1px solid var(--dl-rule); list-style: none; }
.dl-skill { display: grid; grid-template-columns: 88px 1fr; align-items: center; gap: 8px; font-size: 12.5px; color: var(--dl-muted); }
.dl-skill > span { display: inline-flex; align-items: center; gap: 6px; }
.dl-skill .suite-moon { width: 15px; height: 15px; object-fit: contain; }
.dl-skill i { position: relative; height: 9px; border-radius: 5px; background: #e4e9e8; overflow: hidden; }
.dl-skill i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--v) * 100%); border-radius: inherit; background: var(--c); transition: width 1s cubic-bezier(.3, .8, .3, 1); }
.dl-skill--mind { --c: var(--dl-mind); } .dl-skill--act { --c: var(--dl-act); } .dl-skill--mind2act { --c: var(--dl-mind2act); }
.dl-skill.is-growing span { color: var(--c); font-weight: 650; }
/* Round log: one line per round, numbered; the current round is outlined, finished rounds are filled. */
.dl-log { display: grid; gap: 7px; margin: auto 0 0; padding: 14px 0 0; border-top: 1px solid var(--dl-rule); list-style: none; }
.dl-log li { display: grid; grid-template-columns: 20px auto 1fr; align-items: center; gap: 8px; font-size: 12.5px; color: var(--dl-muted); }
.dl-log b { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #c9d3d1; font-size: 11px; font-weight: 650; color: var(--dl-muted); transition: background .3s, border-color .3s, color .3s; }
.dl-log span { font-weight: 600; }
.dl-log small { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-log li.is-now b { border-color: var(--c); color: var(--c); }
.dl-log li.is-now span { color: var(--c); }
.dl-log li.is-done b { border-color: var(--c); background: var(--c); color: #fff; }
.dl-log li.is-done span { color: var(--dl-ink, #203749); }

/* Evaluate */
.dl-suites { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.dl-suites li { padding: 3px 9px; border: 1px solid var(--dl-rule); border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--dl-muted); transition: background .3s, color .3s, border-color .3s; }
.dl-suite--mind { --c: var(--dl-mind); } .dl-suite--act { --c: var(--dl-act); } .dl-suite--mind2act { --c: var(--dl-mind2act); }
.dl-suites li.is-lit { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); color: var(--c); }

/* Diagnosis card: the centre of the figure. */
.dl-node--card { border: 2px solid var(--dl-ink); box-shadow: 0 10px 30px #2037491a; padding: 18px 20px; }
.dl-node--card.is-active { border-color: var(--dl-ink); box-shadow: 0 12px 34px #20374926, 0 0 0 4px color-mix(in srgb, var(--dl-focus) 18%, #fff); }
.dl-title--big { font-size: 22px; font-weight: 700; }
.dl-card { display: grid; grid-template-columns: 104px 1fr; align-items: center; gap: 10px 14px; margin-top: 14px; transition: opacity .4s; }
.dl-figure:not([data-step="2"]):not([data-step="3"]):not([data-step="4"]) .dl-card { opacity: .35; }
.dl-row-label { white-space: nowrap; font-size: 11px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--dl-muted); }
.dl-weak b { display: inline-block; padding: 2px 10px; border-radius: 6px; background: var(--dl-focus); color: #fff; font-size: 14px; transition: background .3s; }
.dl-stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; margin: 0; padding: 0; list-style: none; }
.dl-stages li { padding: 4px 0; border-radius: 4px; background: #eef2f1; color: #8a979d; font-size: 11px; font-weight: 650; text-align: center; transition: background .3s, color .3s; }
.dl-stages li.is-break { background: #b0554f; color: #fff; }
.dl-why code { padding: 2px 6px; border-radius: 4px; background: #17232e; color: #f4f6ef; font: 600 12px/1.3 'JetBrains Mono', ui-monospace, monospace; }
.dl-why span { display: block; margin-top: 4px; font-size: 12.5px; color: var(--dl-muted); white-space: nowrap; }
/* Every round has the same rows and line counts, so the figure keeps one height while it cycles. */
.dl-why { min-height: calc(1.3em + 4px + 1.35em); }
.dl-arch, .dl-weak b, .dl-points b, .dl-lane b { white-space: nowrap; }

/* What helps: three lanes, one per architecture; the active lane is the robot's. */
.dl-lanes { display: grid; gap: 8px; flex: 1; margin: 10px 0 0; padding: 0; list-style: none; }
.dl-lane { --c: var(--dl-e2e); display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-items: center; column-gap: 10px; padding: 8px 10px; border: 1.5px solid #e4e9e8; border-radius: 9px; opacity: .45; transition: opacity .35s, border-color .35s, background .35s; }
.dl-lane--hybrid { --c: var(--dl-hybrid); } .dl-lane--agent { --c: var(--dl-agent); }
.dl-lane.is-on { opacity: 1; border-color: var(--c); background: color-mix(in srgb, var(--c) 7%, #fff); }
.dl-lane-who { grid-column: 1; color: var(--c); font-size: 10.5px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.dl-lane b { grid-column: 1; font-size: 13px; }
.dl-lane > span:last-child { grid-column: 2; grid-row: 1 / span 2; }
.dl-cells { display: grid; grid-template-columns: repeat(4, 10px); gap: 3px; }
.dl-cells i, .dl-books i { display: block; border: 1px solid #d3dad8; border-radius: 2px; background: #fff; transition: background .25s, border-color .25s; }
.dl-cells i { width: 10px; height: 10px; }
.dl-books { display: flex; flex-direction: column-reverse; gap: 2px; }
.dl-books i { width: 30px; height: 5px; }
:is(.dl-cells, .dl-books) i.is-filled { border-color: var(--c); background: var(--c); }
.dl-handoff { display: flex; align-items: center; gap: 4px; }
.dl-handoff i { padding: 1px 5px; border: 1px solid #d3dad8; border-radius: 4px; font-size: 10.5px; font-style: normal; font-weight: 650; color: var(--dl-muted); transition: border-color .25s, color .25s; }
.dl-handoff em { position: relative; width: 20px; height: 2px; margin-right: 5px; color: #d3dad8; background: currentColor; transition: color .25s; }
.dl-handoff em::before { content: ""; position: absolute; right: -6px; top: -4px; border: 5px solid transparent; border-left: 6px solid currentColor; border-right: 0; }
.dl-handoff.is-lit i { border-color: var(--c); color: var(--c); }
.dl-handoff.is-lit em { color: var(--c); }

.dl-return-label { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); padding: 0 10px; background: #fff; font-size: 13px; color: var(--dl-muted); white-space: nowrap; }
.dl-return-label .dl-step { margin-right: 4px; color: var(--dl-lane); }
.dl-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 4px; }
.dl-disclaimer { max-width: 900px; font-size: 13px; color: var(--dl-muted); text-wrap: pretty; }
.dl-toggle { flex: none; min-height: 30px; padding: 4px 12px; border: 1px solid var(--dl-rule); border-radius: 999px; background: #fff; color: var(--dl-ink); font-size: 12px; cursor: pointer; }
.dl-toggle:focus-visible { outline: 2px solid var(--dl-ink); outline-offset: 2px; }

@media (max-width: 960px) {
  .dl-figure { display: flex; flex-direction: column; padding: 0; }
  .dl-steps { grid-template-columns: 1fr; gap: 26px; margin-right: 34px; }
  .dl-node { min-height: 0; }
  .dl-return-label { position: static; transform: none; margin: 14px 0 8px; padding: 0; white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  .dl-robot svg, .dl-skill i::after, .dl-node, .dl-lane, .dl-cells i, .dl-books i, .dl-suites li, .dl-stages li { transition: none; }
}

/* Evaluate: thirty task cells in three rows, lit view by view. */
.dl-grid { display: grid; gap: 10px; margin: auto 0; padding-top: 14px !important; padding: 0; list-style: none; }
.dl-grid li { display: grid; grid-template-columns: 62px repeat(10, 1fr); align-items: center; gap: 3px; }
.dl-grid span { font-size: 11.5px; font-weight: 650; color: var(--c); }
.dl-grid i { height: 18px; border-radius: 2px; background: #e7ecea; transition: background .25s; }
.dl-grid li.is-lit i { background: color-mix(in srgb, var(--c) 70%, #fff); }
.dl-grid li.is-lit i:nth-child(3n) { background: var(--c); }
/* Card additions */
.dl-mini { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.dl-mini li { height: 6px; border-radius: 3px; background: #e7ecea; overflow: hidden; }
.dl-mini li i { display: block; height: 100%; width: calc(var(--v, .3) * 100%); background: var(--c); transition: width .8s; }
.dl-points b { display: inline-block; padding: 2px 10px; border: 1.5px solid var(--dl-lane); border-radius: 999px; color: var(--dl-lane); font-size: 13px; transition: color .3s, border-color .3s; }
.dl-lane b { white-space: nowrap; }

/* Diagram labels remain legible without competing with the page headings. */
body.diagnosis-page .dl { --dl-muted: #454b54; --dl-ink: #111827; }
body.diagnosis-page .dl :is(.dl-step, .dl-round, .dl-skill, .dl-log li, .dl-suites li, .dl-row-label, .dl-stages li, .dl-why span, .dl-lane-who, .dl-return-label, .dl-disclaimer, .dl-toggle, .dl-grid span, .dl-points b) { font-size: 14px; line-height: 1.5; }
body.diagnosis-page .dl-desc { font-size: 16px; line-height: 1.55; }
body.diagnosis-page .dl-title { font-size: 18px; line-height: 1.4; }
body.diagnosis-page .dl-title--big { font-size: 23px; }
body.diagnosis-page .dl-lane b { font-size: 16px; white-space: normal; }
body.diagnosis-page .dl-lane { opacity: 1; }
body.diagnosis-page .dl-figure .dl-card { opacity: 1; }
body.diagnosis-page .dl-card { grid-template-columns: minmax(0, 1fr); gap: 5px; }
body.diagnosis-page .dl-card > :nth-child(even) { margin-bottom: 7px; }
body.diagnosis-page .dl-grid li { grid-template-columns: 72px repeat(10, 1fr); }
body.diagnosis-page .dl .dl-figure .dl-card { opacity: 1 !important; }
body.diagnosis-page .dl-why code, body.diagnosis-page .dl-handoff i { font-size: 14px; }
@media (min-width: 961px) and (max-width: 1200px) {
  body.diagnosis-page .dl-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Retain the diagram's nodes, while keeping their labels and frames understated. */
body.diagnosis-page .dl-node { border-radius: 5px; box-shadow: none; }
body.diagnosis-page .dl-node--card { border-width: 1px; border-color: var(--m2a-ink, #17212b); }
body.diagnosis-page .dl-node.is-active { box-shadow: none; }
body.diagnosis-page .dl-lane { border-radius: 3px; border-width: 1px; padding: 12px 10px; }
body.diagnosis-page .dl :is(.dl-step, .dl-row-label, .dl-title, .dl-lane b) { color: var(--m2a-ink, #17212b); }
body.diagnosis-page .dl-stages li:not(.is-break) { color: var(--m2a-muted, #4c5965); }


/* Compact figure. The card pairs its short fields side by side, so the row is set by content rather than
   by one tall column; the other nodes keep their content together at the top instead of spreading it out. */
body.diagnosis-page .dl-card { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin-top: 10px; }
body.diagnosis-page .dl-card > :nth-child(even) { margin-bottom: 0; }
body.diagnosis-page .dl-field { display: grid; gap: 5px; align-content: start; min-width: 0; }
body.diagnosis-page :is(.dl-field--views, .dl-field--wide) { grid-column: 1 / -1; }
body.diagnosis-page .dl-why { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 0; }
body.diagnosis-page .dl-why span { display: inline; margin-top: 0; }
body.diagnosis-page .dl-title--big { margin-top: 2px !important; }
body.diagnosis-page .dl-node { padding: 16px 18px; }
body.diagnosis-page .dl-node--card { padding: 16px 20px; }
/* Evaluate: the grid follows the title, the counts follow the grid. */
body.diagnosis-page .dl-grid { margin: 14px 0 0; padding-top: 0 !important; gap: 9px; }
body.diagnosis-page .dl-desc { margin-top: 14px !important; padding-top: 0; }
/* What helps: two short lanes with the action and its picture on one line. */
body.diagnosis-page .dl-lanes { flex: none; gap: 8px; margin-top: 12px; }
body.diagnosis-page .dl-lane { padding: 10px 12px; row-gap: 2px; }
body.diagnosis-page .dl-config { display: grid; gap: 8px; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--dl-rule); }
body.diagnosis-page .dl-config div { display: grid; grid-template-columns: 72px 1fr; align-items: center; }
body.diagnosis-page .dl-config dt { font-size: 14px; color: var(--dl-muted); }
body.diagnosis-page .dl-config dd { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; }
body.diagnosis-page .dl-config span { padding: 1px 8px; border: 1px solid var(--dl-rule); border-radius: 999px; font-size: 13px; line-height: 1.5; color: var(--m2a-ink, #17212b); }
body.diagnosis-page .dl-desc { margin-top: auto !important; padding-top: 12px; }
body.diagnosis-page .dl-desc b { color: var(--m2a-ink, #17212b); }
body.diagnosis-page .dl-lanes { flex: 1; grid-auto-rows: 1fr; }
body.diagnosis-page .dl-lane { align-content: center; }
body.diagnosis-page .dl-config div { grid-template-columns: 54px 1fr; }
body.diagnosis-page .dl-config dd { gap: 3px; }
body.diagnosis-page .dl-config span { padding: 0 6px; font-size: 12.5px; }
body.diagnosis-page .dl-desc { font-size: 14px; }
body.diagnosis-page .dl-config { gap: 10px; }
body.diagnosis-page .dl-config div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
body.diagnosis-page .dl-config dt { font-size: 13px; }
