/* The graphic is subordinate to actual server records. All styles stay in this component. */
#modal.processing-modal:has(.processing-core) {
  width: min(940px, calc(100vw - 32px));
  max-width: 940px;
  max-height: calc(100dvh - 32px);
}
#modal.processing-modal:has(.processing-core) .modal-body {
  max-height: calc(100dvh - 170px);
  overflow: auto;
  overscroll-behavior: contain;
}
.processing-core {
  --pn-core-color: #72c9ff;
  color: #c9e0ed;
  isolation: isolate;
  margin: 0 0 26px;
  padding: 0;
  background: #02070b;
  border-radius: 14px;
  overflow: hidden;
  container-type: inline-size;
}
.pn-heading { padding: 22px 24px 0; position: relative; z-index: 2; }
.pn-heading > span { color: #91b1c2; font-size: 11px; letter-spacing: .08em; }
.pn-status { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px 18px; margin-top: 8px; }
.pn-status h3 { margin: 0; font-size: 18px; line-height: 1.45; font-weight: 500; letter-spacing: .01em; color: #e4f3fa; }
.pn-status p { margin: 0; color: #91a9b8; font-size: 11px; line-height: 1.7; }
.pn-stage { position: relative; height: 450px; overflow: hidden; }
.pn-canvas { position: absolute; inset: 0; pointer-events: none; }
.pn-canvas canvas { display: block; width: 100%; height: 100%; }
.pn-ports { position: absolute; z-index: 2; inset: 0; list-style: none; padding: 0; margin: 0; pointer-events: none; }
.pn-rule {
  --pn-x: 8%; --pn-y: 28%;
  position: absolute; left: var(--pn-x); top: var(--pn-y);
  width: 108px; padding: 9px 10px;
  background: linear-gradient(110deg, #02070bb3, #02070b00);
  border: 0; border-radius: 8px; color: #8ca6b6;
  transition: color 160ms ease-out, background-color 160ms ease-out;
}
.pn-rule:nth-child(2) { --pn-x: 15%; --pn-y: 62%; }
.pn-rule:nth-child(3) { --pn-x: 49%; --pn-y: 6%; }
.pn-rule:nth-child(4) { --pn-x: 79%; --pn-y: 30%; }
.pn-rule:nth-child(5) { --pn-x: 75%; --pn-y: 66%; }
.pn-rule:nth-child(6) { --pn-x: 43%; --pn-y: 82%; }
.pn-rule strong { display: block; color: inherit; font-size: 12px; line-height: 1.5; font-weight: 450; white-space: nowrap; }
.pn-rule-state { display: block; font-size: 10px; line-height: 1.5; margin-top: 4px; color: #8aa2b1; white-space: nowrap; }
.pn-port { position: absolute; width: 5px; height: 5px; border-radius: 50%; top: 22px; right: -1px; background: #466379; transition: background-color 160ms ease-out, box-shadow 160ms ease-out; }
.pn-rule:nth-child(3) .pn-port { top: auto; bottom: -1px; left: 35%; right: auto; }
.pn-rule:nth-child(4) .pn-port, .pn-rule:nth-child(5) .pn-port { right: auto; left: -1px; }
.pn-rule:nth-child(6) .pn-port { top: -1px; left: 64%; right: auto; }
.pn-rule[data-state="received"] { color: #bed6e2; }
.pn-rule[data-state="received"] .pn-port { background: #648da4; }
.pn-rule[data-receiving="true"] { color: #e1f6ff; background-color: #10232c80; }
.pn-rule[data-receiving="true"] .pn-port { background: #effcff; box-shadow: 0 0 9px var(--pn-core-color), 0 0 17px color-mix(in srgb, var(--pn-core-color), transparent 40%); }
.pn-stage-caption { position: absolute; z-index: 2; bottom: 10px; left: 24px; color: #819ba9; font-size: 10px; line-height: 1.5; }
.pn-presentation-controls { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; padding: 12px 24px 16px; }
.pn-presentation-note { color: #94afbf; font-size: 11px; line-height: 1.6; }
.pn-presentation-controls > div { display: flex; gap: 8px; }
.pn-presentation-controls button { appearance: none; border: 1px solid #3b5362; border-radius: 6px; background: #0b161e; color: #d4e8f3; font: inherit; font-size: 11px; line-height: 1.5; padding: 8px 11px; cursor: pointer; transition: border-color 160ms ease-out, background-color 160ms ease-out; }
.pn-presentation-controls button:hover { background: #142631; border-color: #7095ab; }
.pn-presentation-controls button:focus-visible { outline: 2px solid #92d4ff; outline-offset: 3px; }
.pn-presentation-controls button:disabled { color: #90a5b2; border-color: #344550; cursor: default; }
.pn-presentation-controls[hidden], .pn-presentation-controls button[hidden] { display: none; }
.processing-core[data-presentation="paused"] .pn-rule[data-replaying="true"] .pn-port { background: #b4d8ed; box-shadow: 0 0 6px #72c9ff55; }
.pn-metrics { display: flex; flex-wrap: wrap; gap: 15px 32px; margin: 0; padding: 16px 24px 21px; border-top: 1px solid #25333c; }
.pn-metrics[hidden], .pn-graphic-note[hidden] { display: none; }
.pn-metrics > div { display: flex; gap: 10px; align-items: baseline; }
.pn-metrics dt { color: #91a9b8; font-size: 10px; }
.pn-metrics dd { margin: 0; color: #cbe3ef; font-size: 16px; font-weight: 450; font-variant-numeric: tabular-nums; }
.pn-graphic-note { color: #bdcdd5; font-size: 11px; line-height: 1.7; padding: 0 24px 20px; margin: 0; }
.processing-core[data-job-status="failed"] .pn-status h3,
.processing-core[data-job-status="cancelled"] .pn-status h3,
.processing-core[data-job-status="interrupted"] .pn-status h3 { color: #e5c6b9; }
.processing-core[data-graphic="unavailable"] .pn-stage { height: 250px; }
.processing-core[data-graphic="unavailable"] .pn-stage-caption { display: none; }
.processing-core[data-graphic="unavailable"] .pn-ports { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 25px; align-content: center; }
.processing-core[data-graphic="unavailable"] .pn-rule { position: relative; left: auto; top: auto; width: auto; background: none; }
.processing-core[data-graphic="unavailable"] .pn-port { display: none; }
.processing-modal .processing-records { border-top: 1px solid var(--ui-divider, #293138); padding: 0; }
.processing-modal .processing-records > summary { cursor: pointer; padding: 14px 0; color: var(--ui-secondary, #b5bfc6); font-size: 12px; line-height: 1.6; }
.processing-modal .processing-records > summary:focus-visible { outline: 2px solid #72c9ff; outline-offset: 3px; border-radius: 3px; }
.processing-modal .processing-records .processing-status { padding-top: 12px; }
@container (max-width: 580px) {
  .pn-heading { padding: 20px 18px 0; }
  .pn-status { display: block; }
  .pn-status h3 { font-size: 17px; }
  .pn-status p { margin-top: 6px; font-size: 11px; }
  .pn-stage { height: 420px; }
  .pn-rule { width: 88px; padding: 7px; --pn-x: 2%; --pn-y: 28%; }
  .pn-rule:nth-child(2) { --pn-x: 5%; --pn-y: 60%; }
  .pn-rule:nth-child(3) { --pn-x: 48%; --pn-y: 5%; }
  .pn-rule:nth-child(4) { --pn-x: 77%; --pn-y: 30%; }
  .pn-rule:nth-child(5) { --pn-x: 75%; --pn-y: 68%; }
  .pn-rule:nth-child(6) { --pn-x: 37%; --pn-y: 83%; }
  .pn-rule { left: min(var(--pn-x), calc(100% - 89px)); }
  .pn-rule strong { font-size: 11px; }
  .pn-rule-state { font-size: 9px; margin-top: 3px; }
  .pn-port { top: 18px; }
  .pn-stage-caption { left: 18px; font-size: 9px; }
  .pn-metrics { gap: 12px 22px; padding: 15px 18px 18px; }
  .pn-metrics > div { gap: 7px; }
  .pn-metrics dd { font-size: 15px; }
  .pn-graphic-note { padding-inline: 18px; }
  .pn-presentation-controls { padding-inline: 18px; }
  .pn-presentation-controls button { min-height: 40px; }
}
@container (max-width: 360px) {
  .pn-stage { height: 410px; }
  .pn-rule { width: 78px; left: min(var(--pn-x), calc(100% - 80px)); }
  .pn-rule:nth-child(1) { --pn-x: 1%; --pn-y: 25%; }
  .pn-rule:nth-child(2) { --pn-x: 3%; --pn-y: 61%; }
  .pn-rule:nth-child(4) { --pn-x: 75%; --pn-y: 32%; }
  .pn-rule:nth-child(5) { --pn-x: 74%; --pn-y: 66%; }
  .pn-rule strong { font-size: 10px; }
  .pn-rule-state { font-size: 9px; }
  .processing-core[data-graphic="unavailable"] .pn-ports { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  #modal.processing-modal:has(.processing-core) { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  #modal.processing-modal:has(.processing-core) .modal-body { max-height: calc(100dvh - 152px); }
}
@media (prefers-reduced-motion: reduce) {
  .processing-core *, .processing-core *::before, .processing-core *::after { animation: none !important; transition: none !important; }
}
/* Match cards reuse the original neural endpoints: input -> candidate -> selected. */
.pn-rule:has(.pn-match-button:not([hidden])){width:150px;padding:0;background:transparent;pointer-events:auto}
.pn-match-button{display:block;width:100%;text-align:left;border:1px solid #38546699;border-radius:9px;padding:10px 11px;background:#07151deb;color:#a8c5d7;font:inherit;cursor:pointer;transition:transform .55s ease,opacity .55s ease,border-color .4s ease,background .4s ease}
.pn-match-button[hidden]{display:none}
.pn-rule > strong[hidden],.pn-rule-state[hidden]{display:none}
.pn-match-name{display:block;font-size:11px;line-height:1.6;overflow-wrap:anywhere}
.pn-match-outcome{display:block;font-size:10px;line-height:1.5;margin-top:5px;color:#90b6c7}
.pn-rule[data-match-state="reading"] .pn-match-button{transform:translateY(8px) scale(.95);opacity:.75}
.pn-rule[data-match-state="candidate"] .pn-match-button{border-color:#72c9ff99;background:#102c3be8}
.pn-rule[data-match-state="excluded"] .pn-match-button{transform:translateY(-12px) scale(.92);opacity:.46;border-style:dashed}
.pn-rule[data-match-state="excluded"] .pn-match-outcome{color:#c7a69b}
.pn-rule[data-match-state="selected"] .pn-match-button{transform:translateY(3px) scale(1.035);border-color:#89e7c9;background:#10362ee8;box-shadow:0 0 18px #6adac51c}
.pn-rule[data-match-state="selected"] .pn-match-outcome{color:#a2edd9}
.pn-rule[data-match-active="true"] .pn-match-button,.pn-match-button:focus-visible{outline:1px solid #d4f2ff;outline-offset:3px;opacity:1}
.pn-match-detail{margin:0;padding:12px 24px 15px;color:#a8c4d3;font-size:11px;line-height:1.8;border-top:1px solid #25333c;min-height:55px}
.pn-match-detail[hidden]{display:none}
@container(max-width:580px){.pn-rule:has(.pn-match-button:not([hidden])){width:108px;left:min(var(--pn-x),calc(100% - 113px))}.pn-match-button{padding:8px}.pn-match-name{font-size:10px}.pn-match-detail{padding-inline:18px}}
@container(max-width:360px){.pn-rule:has(.pn-match-button:not([hidden])){width:91px;left:min(var(--pn-x),calc(100% - 95px))}.pn-match-name{font-size:9px}}
