.harness-guide { margin: 1.5rem 0 2rem; scroll-margin-top: 5rem; min-width: 0; }
.harness-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 0 .85rem; }
.harness-heading h3 { margin: 0; font-size: 1.35rem; line-height: 1.3; }
.harness-heading h3 span { font-weight: 400; color: var(--text-2); margin-left: .35rem; }
.harness-time { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.harness-time strong { font-size: 1.3rem; }
.harness-time span { display: block; font-size: .7rem; color: var(--text-2); margin-top: .18rem; }
.harness-workbench { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 18.5rem; height: 680px; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; min-width: 0; background: var(--surface); }
.harness-visual { min-width: 0; display: flex; flex-direction: column; color: #193451; background: #e2eaf4; --bench-muted: #4b617a; }
.harness-guide button { font-family: inherit; cursor: pointer; line-height: 1.4; }
.harness-guide button:disabled { cursor: default; opacity: .4; }
.harness-guide button:focus-visible, .harness-guide input:focus-visible, .harness-stage:focus-visible, .harness-guide summary:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; }
.harness-toolbar { display: flex; align-items: center; gap: .3rem; padding: .65rem; border-bottom: 1px solid #b9c8db; flex-wrap: wrap; }
.harness-toolbar button { color: inherit; background: #f5f8fc88; border: 1px solid #a9bbd2; border-radius: 4px; padding: .36rem .5rem; font-size: .65rem; white-space: nowrap; }
.harness-toolbar button:hover { background: #fff; }
.harness-views { display: flex; flex-wrap: wrap; gap: .25rem; margin-right: auto; }
.harness-views button[aria-pressed="true"] { color: #fff; background: #244766; border-color: #244766; }
.harness-navigation { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem 1rem; padding: .4rem .65rem; border-bottom: 1px solid #b9c8db; font-size: .62rem; }
.harness-navigation > div { display: flex; gap: .2rem; }
.harness-navigation button { color: inherit; background: #f5f8fc88; border: 1px solid #a9bbd2; border-radius: 4px; padding: .3rem .65rem; font-size: .65rem; }
.harness-navigation button[aria-pressed="true"] { color: #fff; background: #244766; border-color: #244766; }
.harness-navigation > span { color: var(--bench-muted); }
.harness-stage { flex: 1; min-height: 0; position: relative; overflow: hidden; touch-action: none; scroll-margin-top: 55px; background: radial-gradient(ellipse at 45% 25%, #f6f9fd, #d7e2ef); }
.harness-stage canvas { display: block; width: 100%; height: 100%; position: absolute; inset: 0; touch-action: none; cursor: grab; }
.harness-stage canvas:active { cursor: grabbing; }
.harness-stage .harness-gizmo { inset: auto auto .4rem .4rem; width: var(--cube-size); height: var(--cube-size); z-index: 3; cursor: pointer; }
.harness-loading { position: absolute; z-index: 4; inset: 38% 10% auto; margin: 0; color: var(--bench-muted); text-align: center; font-size: .8rem; }
.harness-leaders, .harness-labels { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.harness-leaders line { stroke: #657c95; stroke-width: 1; stroke-opacity: .72; }
.harness-leaders circle { fill: #f6f9fd; stroke: #546c87; stroke-width: 1.3; }
.harness-leaders .is-selected { stroke: #b56320; stroke-width: 2; stroke-opacity: 1; }
.harness-label { position: absolute; transform: translate(-50%, -50%); color: #28435e; background: #f5f8fdeb; border: 1px solid #a6b9cf; border-radius: 4px; padding: .32rem .48rem; white-space: nowrap; font-size: 11px; pointer-events: auto; box-shadow: 0 2px 5px #173c5b0c; }
.harness-label:hover { background: #fff; border-color: #456a8d; }
.harness-label[aria-pressed="true"] { background: #fff0df; border-color: #ac591a; color: #784216; box-shadow: 0 0 0 2px #de99513b; }
.harness-stage:is([data-navigation="pan"], [data-navigation="zoom"]) .harness-label { pointer-events: none; }
.harness-open-banner { position: absolute; top: .75rem; left: .75rem; right: .75rem; display: flex; align-items: center; justify-content: space-between; gap: .6rem; border: 1px solid #d8ad7b; background: #fff7eaeF; border-radius: 5px; padding: .55rem .65rem; font-size: .74rem; }
.harness-open-banner button { color: #784216; background: #fff; border: 1px solid #c89a65; border-radius: 4px; font-size: .7rem; padding: .35rem .5rem; flex-shrink: 0; }
.harness-scene-controls { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem 1rem; border-top: 1px solid #b9c8db; padding: .6rem .75rem; font-size: .65rem; }
.harness-scene-controls label { display: flex; align-items: center; gap: .3rem; }
.harness-scene-controls input { accent-color: #244766; }
.harness-scene-controls button, .harness-hide { border: 1px solid #a9bbd2; color: inherit; background: #f5f8fc88; padding: .25rem .4rem; border-radius: 4px; font-size: .65rem; }
.harness-explode { margin-left: auto; }
.harness-explode input { width: 65px; min-width: 0; }
.harness-explode output { width: 2rem; text-align: right; font-variant-numeric: tabular-nums; }
.harness-caption { color: var(--bench-muted); margin: 0; padding: .25rem .75rem .75rem; font-size: .67rem; line-height: 1.6; }
.harness-caption span { display: block; font-size: .6rem; color: #64758c; }
.harness-inspector { min-width: 0; min-height: 0; overflow: auto; background: var(--surface); border-left: 1px solid var(--border); font-size: .75rem; scrollbar-width: thin; }
.harness-find { padding: .65rem .75rem; border-bottom: 1px solid var(--border); }
.harness-find input { width: 100%; box-sizing: border-box; padding: .55rem .65rem; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 5px; font: inherit; font-size: .72rem; }
.harness-find input::placeholder { color: var(--text-3); opacity: 1; }
[data-harness-find-results] { display: flex; flex-direction: column; gap: .3rem; margin-top: .5rem; }
[data-harness-find-results] button { text-align: left; border: 1px solid var(--border); color: var(--text); background: var(--bg); border-radius: 4px; padding: .4rem .5rem; font-size: .7rem; }
[data-harness-find-results] p { margin: .25rem; color: var(--text-2); font-size: .7rem; }
.harness-tabs { display: flex; position: sticky; top: 0; z-index: 2; background: var(--surface); border-bottom: 1px solid var(--border); }
.harness-tabs button { flex: 1; background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--text-3); padding: .85rem .4rem; font-size: .73rem; }
.harness-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--action); }
.harness-pane { padding: .9rem; }
.harness-pane h4 { margin: .75rem 0; font-size: .92rem; line-height: 1.45; }
.harness-panel-intro { margin: 0 0 .7rem; color: var(--text-2); font-size: .72rem; }
.harness-conductors { display: flex; flex-direction: column; gap: .35rem; }
.harness-conductors button { display: flex; align-items: center; gap: .55rem; text-align: left; width: 100%; border: 1px solid var(--border); color: var(--text); background: var(--bg); padding: .6rem .55rem; border-radius: 5px; font-size: .72rem; }
.harness-conductors button:hover { border-color: var(--action); background: var(--surface-2); }
.harness-wire-swatch { flex-shrink: 0; width: 23px; height: 6px; border-radius: 3px; background: #151c26; box-shadow: 0 0 0 1px #77808c; }
.harness-wire-swatch.is-striped { background: linear-gradient(#141c25 0 30%, #f8f6ec 30% 65%, #141c25 65%); }
.harness-map-status, .harness-practice-note { color: var(--text-3); font-size: .68rem; line-height: 1.65; margin: 1rem 0 .25rem; }
.harness-back { color: var(--text-2); font-size: .69rem; border: 0; background: none; padding: 0; }
.harness-back:hover { color: var(--action); }
.harness-open { width: 100%; border: 1px solid var(--action); border-radius: 5px; background: var(--action); color: var(--bg); padding: .6rem; font-weight: 600; font-size: .77rem; margin: 0 0 .85rem; }
.harness-open:hover { filter: brightness(1.08); }
.harness-hide { margin: 0 0 .75rem; color: var(--text-2); border-color: var(--border); background: var(--bg); }
.harness-connection { padding: .1rem 0 .5rem; }
.harness-connection button { display: block; text-align: left; width: 100%; padding: .55rem .65rem; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 5px; }
.harness-connection button:hover { border-color: var(--action); }
.harness-connection small { display: block; font-size: .55rem; letter-spacing: .1em; color: var(--text-3); }
.harness-connection strong { display: block; font-size: .77rem; font-weight: 500; margin: .15rem 0; }
.harness-connection button > span { display: block; font-size: .6rem; color: var(--text-3); }
.harness-connection-arrow { color: var(--action); text-align: center; padding: .1rem; }
.harness-selection > p { color: var(--text-2); font-size: .7rem; line-height: 1.65; margin: .5rem 0; }
.harness-inspector dl { margin: .65rem 0; }
.harness-inspector dl > div { padding: .55rem 0; border-bottom: 1px solid var(--border); }
.harness-inspector dt { color: var(--text-3); font-size: .64rem; }
.harness-inspector dd { margin: .2rem 0 0; color: var(--text); line-height: 1.6; font-size: .71rem; overflow-wrap: anywhere; }
[data-harness-part-wires] { display: flex; flex-direction: column; gap: .3rem; }
[data-harness-part-wires] button { text-align: left; border: 1px solid var(--border); color: var(--text-2); background: var(--bg); border-radius: 4px; padding: .4rem .5rem; font-size: .68rem; }
.harness-sequence-heading { color: var(--text-3); font-size: .65rem; margin-bottom: .75rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.harness-sequence-heading button, .harness-step-nav button { background: none; color: var(--text); border: 1px solid var(--border); border-radius: 4px; font-size: .64rem; padding: .35rem .5rem; }
.harness-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .35rem; }
.harness-steps button { width: 100%; display: grid; grid-template-columns: .8rem 1fr 2.8rem; text-align: left; gap: .4rem; padding: .55rem .5rem; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 4px; font-size: .68rem; }
.harness-steps button strong { font-weight: 400; }
.harness-steps button b { font-weight: 400; color: var(--text-3); text-align: right; font-size: .64rem; }
.harness-steps button > span { color: var(--text-3); }
.harness-steps button[aria-pressed="true"] { border-color: var(--action); background: var(--surface-2); }
.harness-step-detail { margin-top: 1rem; }
.harness-step-detail [data-harness-step-index] { font-size: .62rem; color: var(--text-3); }
.harness-step-detail h4 { font-size: .85rem; }
.harness-step-detail [data-harness-step-copy] { font-size: .72rem; color: var(--text-2); line-height: 1.75; }
.harness-step-nav { display: flex; justify-content: space-between; gap: .5rem; }
.harness-basis { margin-top: .75rem; }
.harness-guide details > summary { padding: .6rem 0; color: var(--text-3); font-size: .7rem; cursor: pointer; }
.harness-guide details > summary::after { content: '+'; }
.harness-guide details[open] > summary::after { content: '−'; }
.harness-basis p, .harness-fallback { font-size: .73rem; line-height: 1.7; color: var(--text-2); }
.harness-fallback { overflow-x: auto; }
.harness-fallback table { width: 100%; border-collapse: collapse; }
.harness-fallback th, .harness-fallback td { text-align: left; padding: .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.harness-fallback li { padding: .3rem; }
.harness-guide.is-interactive .harness-fallback { display: none; }
.harness-guide [hidden] { display: none !important; }
.harness-modal-open { overflow: hidden; }
.harness-launch { position: absolute; inset: 0; z-index: 5; display: flex; align-items: flex-end; width: 100%; border: 0; padding: .8rem 1rem; text-align: left; color: #193451; background: linear-gradient(transparent 45%, #eef4fbeF); }
.harness-launch strong, .harness-launch small { display: block; }
.harness-launch strong { font-size: .8rem; font-weight: 600; }
.harness-launch small { font-size: .66rem; margin-top: .1rem; color: #4b617a; }
.harness-launch:hover { background: linear-gradient(transparent 40%, #fff); }
.harness-guide.is-preview .harness-workbench { display: block; height: 190px; }
.harness-guide.is-preview .harness-visual { height: 100%; }
.harness-guide.is-preview .harness-stage { height: 100%; }
.harness-guide.is-preview :is(.harness-toolbar, .harness-navigation, .harness-inspector, .harness-scene-controls, .harness-caption, .harness-labels, .harness-leaders, .harness-open-banner, .harness-gizmo) { display: none !important; }
.harness-dialog::backdrop { background: #101d36bb; }
.harness-dialog[open] { position: fixed; inset: 0; display: flex; flex-direction: column; box-sizing: border-box; width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--bg); color: var(--text); overscroll-behavior: contain; }
.harness-dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-shrink: 0; padding: max(.65rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) .65rem max(1rem, env(safe-area-inset-left)); border-bottom: 1px solid var(--border); }
.harness-dialog-heading strong { font-size: .85rem; font-weight: 500; }
.harness-dialog-heading button { flex-shrink: 0; padding: .4rem .7rem; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 5px; font-size: .75rem; }
.harness-dialog .harness-workbench { flex: 1; min-height: 0; width: 100%; height: auto; border: 0; border-radius: 0; grid-template-columns: minmax(0, 1fr) 22rem; }
.harness-dialog .harness-stage { min-height: 0; }
.harness-dialog [data-harness-fullscreen] { display: none; }
@media (max-width: 1000px) {
  .harness-workbench { grid-template-columns: minmax(0, 1fr) 16.5rem; }
  .harness-explode { margin-left: 0; }
}
@media (min-width: 1100px) {
  /* The workbench gets enough width to inspect a complete piece inside costs. */
  #wiring[open] { width: min(1220px, calc(100vw - 70px)); margin-left: 50%; transform: translateX(-50%); }
}
@media (max-width: 960px) {
  .harness-dialog .harness-workbench { display: block; overflow: auto; padding-bottom: env(safe-area-inset-bottom); }
  .harness-dialog .harness-stage { height: clamp(260px, 52dvh, 560px); }
  .harness-dialog .harness-inspector { max-height: none; overflow: visible; }
}
@media (max-width: 760px) {
  .harness-workbench { grid-template-columns: minmax(0, 1fr); height: auto; }
  .harness-inspector { max-height: none; border-left: 0; border-top: 1px solid var(--border); }
  .harness-stage { flex: none; height: 400px; min-height: 0; }
  .harness-conductors { display: grid; grid-template-columns: 1fr 1fr; }
  .harness-selection dl, [data-harness-materials] { display: grid; grid-template-columns: 1fr 1fr; gap: .1rem 1rem; }
  .harness-connection { display: grid; grid-template-columns: minmax(0, 1fr) 1rem minmax(0, 1fr); align-items: center; gap: .3rem; }
  .harness-connection-arrow { transform: rotate(-90deg); }
}
@media (max-width: 480px) {
  .harness-heading { align-items: flex-start; }
  .harness-heading h3 { font-size: 1.12rem; }
  .harness-heading h3 span { display: block; margin: .1rem 0 0; font-size: .86rem; }
  .harness-time strong { font-size: 1.15rem; }
  .harness-time span { font-size: .61rem; }
  .harness-toolbar { padding: .5rem; }
  .harness-views { width: 100%; }
  .harness-toolbar button { padding: .3rem .4rem; font-size: .61rem; }
  .harness-stage { height: 355px; }
  .harness-scene-controls { font-size: .61rem; gap: .6rem; }
  .harness-caption { font-size: .62rem; }
  .harness-caption span { font-size: .56rem; }
  .harness-conductors { display: flex; }
  .harness-pane { padding: .85rem; }
  .harness-label { font-size: 10px; padding: .25rem .3rem; }
  .harness-open-banner { font-size: .62rem; padding: .4rem; top: .5rem; left: .5rem; right: .5rem; }
  .harness-open-banner button { font-size: .6rem; padding: .3rem; }
}
