/* Static timing problems (kind "sta"): a circuit to click on. State is never colour alone: picked cells get a thick outline + the path chips, wrong steps get a text mark. */
#staPanel { flex: 1 1 55%; min-height: 200px; overflow: auto; padding: 16px; border-bottom: 1px solid var(--line); }
#staPanel[hidden] { display: none; }
.sta-status { min-height: 22px; margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.sta-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 8px 4px; }
.sta-svg { display: block; width: 100%; height: auto; font-family: var(--mono, ui-monospace, monospace); }
.sta-w { fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linejoin: round; }
.sta-e.clk .sta-w { stroke-dasharray: 5 4; stroke-width: 1.5; }
.sta-hit { fill: none; stroke: transparent; stroke-width: 12; pointer-events: stroke; }
.sta-e.hl .sta-w { stroke: var(--ink); stroke-width: 3; }
.sta-e.on .sta-w { stroke: var(--accent); stroke-width: 4; stroke-dasharray: 9 6; animation: sta-flow .9s linear infinite; }
.sta-b { fill: var(--bg, var(--panel)); stroke: var(--muted); stroke-width: 1.8; }
.sta-b.sta-ck { stroke-dasharray: 4 3; }
.sta-tri { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.sta-nm { font-size: 13px; font-weight: 700; fill: var(--ink); }
.sta-dl { font-size: 12px; fill: var(--ink); }
.sta-sm { font-size: 11.5px; fill: var(--muted); }
.sta-ft { font-size: 10px; fill: var(--muted); }
.sta-pn { font-size: 10.5px; fill: var(--muted); }
.sta-lat { font-size: 9.5px; fill: var(--ink); }
.sta-go { cursor: pointer; }
.sta-go:focus { outline: none; }
.sta-go:focus-visible .sta-b { stroke: var(--ink); stroke-width: 3.5; }
.sta-n.hl .sta-b { stroke: var(--ink); stroke-width: 3; fill: color-mix(in srgb, var(--accent) 12%, var(--panel)); }
.sta-n.on .sta-b { stroke: var(--accent); stroke-width: 4; fill: color-mix(in srgb, var(--accent) 22%, var(--panel)); animation: sta-pulse 1.2s ease-in-out infinite; }
.sta-read { min-height: 20px; margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.sta-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 6px 0 12px; font-size: 12.5px; color: var(--muted); }
.sta-legend b { color: var(--ink); }
.sta-steps { display: flex; flex-direction: column; gap: 14px; }
.sta-step { margin: 0; padding: 0; border: 0; min-width: 0; }
.sta-q { font-weight: 600; font-size: 14px; padding: 0; margin: 0 0 6px; display: block; }
.sta-mk { font-weight: 600; font-size: 12.5px; margin-left: 6px; }
.sta-mk.ok { color: var(--ok); } .sta-mk.bad { color: var(--bad); }
.sta-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 32px; font-size: 13px; }
.sta-chip { padding: 3px 8px; border-radius: 6px; background: var(--chip); font: 600 12.5px var(--mono, ui-monospace, monospace); }
.sta-arr { color: var(--muted); }
.sta-tools { display: flex; gap: 6px; margin-top: 6px; }
.sta-btn { min-height: 30px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
.sta-btn:hover { background: var(--chip); }
.sta-btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.sta-num { display: flex; align-items: center; gap: 8px; }
.sta-num input { width: 110px; min-height: 36px; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: 14px var(--mono, ui-monospace, monospace); }
.sta-num input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sta-opts { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.sta-opt { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; font-size: 14px; cursor: pointer; }
.sta-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sta-why { margin: 8px 0 12px; padding: 10px 14px; border-radius: 10px; background: var(--chip); font-size: 13.5px; }
.sta-why p { margin: 0 0 6px; } .sta-why ul { margin: 0; padding-left: 18px; } .sta-why li { margin: 2px 0; font-family: var(--mono, ui-monospace, monospace); font-size: 12.5px; }
@keyframes sta-flow { to { stroke-dashoffset: -30; } }
@keyframes sta-pulse { 50% { stroke-width: 6; } }
@media (prefers-reduced-motion: reduce) { .sta-e.on .sta-w, .sta-n.on .sta-b { animation: none; } .sta-e.on .sta-w { stroke-dasharray: none; } }
@media (max-width: 900px) { #staPanel { overflow: visible; } .sta-btn { min-height: 44px; } .sta-num input { min-height: 44px; } .sta-opt { min-height: 44px; } }
@media (max-width: 430px) { #staPanel { padding: 16px 12px; } }
.sta-hr { fill: transparent; stroke: none; }
.sta-svg { margin: 0 auto; max-height: 52vh; }
/* no-code problems: the panel gets the column, the result is only as tall as its text */
@media (min-width: 901px) {
  #work:has(#staPanel:not([hidden]), #wavePanel:not([hidden]), #kmapPanel:not([hidden])) #staPanel:not([hidden]),
  #work:has(#staPanel:not([hidden]), #wavePanel:not([hidden]), #kmapPanel:not([hidden])) #wavePanel:not([hidden]),
  #work:has(#staPanel:not([hidden]), #wavePanel:not([hidden]), #kmapPanel:not([hidden])) #kmapPanel:not([hidden]) { flex: 1 1 auto; min-height: 60%; }
  #work:has(#staPanel:not([hidden]), #wavePanel:not([hidden]), #kmapPanel:not([hidden])) #result { flex: 0 1 auto; min-height: 56px; max-height: 40%; }
}
