/* pneumatic cylinder — on top of calc.css */
#view { display: block; width: 100%; height: auto; flex: 1; min-height: 0; user-select: none; touch-action: none; }
#view.dragging, #view.dragging * { cursor: grabbing !important; }
#view .handle { cursor: grab; }
#view .handle .hit { fill: transparent; }
#view .handle .knob { fill: var(--surface); stroke: var(--sel); stroke-width: 1.8; }
#view .handle:hover .knob { fill: var(--sel); }
#view .pill rect { fill: var(--surface); stroke: var(--steel-300); }
#view .pill text { font-size: 11.5px; font-weight: 500; fill: var(--text-2); font-variant-numeric: tabular-nums; }
#view .pill.p rect { fill: color-mix(in srgb, var(--surface) 94%, transparent); stroke: color-mix(in srgb, var(--sel) 35%, transparent); }
#view .pill.p text { fill: var(--x-1e4fbf, #1e4fbf); font-weight: 600; }
#view .pill.load rect { stroke: color-mix(in srgb, var(--load) 35%, transparent); } #view .pill.load text { fill: var(--load); font-weight: 600; }
#view .pill.mass rect { fill: color-mix(in srgb, var(--surface) 90%, transparent); } #view .pill.mass text { fill: var(--text); font-weight: 600; }
#view .pill.dimv rect { stroke: var(--steel-200); }
#view .pill.editable { cursor: text; }
#view .pill.editable:hover rect { stroke: var(--sel); stroke-width: 1.4; }
#view .pill.editable:focus { outline: none; }
#view .pill.editable:focus rect { stroke: var(--sel); stroke-width: 1.6; }
#view .pn-small { fill: var(--text-2); }

/* parts: the quiet palette of the hydraulic cylinder */
#view .part { fill: var(--steel-200); stroke: var(--steel-600); stroke-width: 1; }
#view .hole { fill: var(--surface); stroke: var(--steel-700); stroke-width: 1.2; }
#view .barrel { fill: var(--steel-100); stroke: var(--steel-600); stroke-width: 1; }
#view .groove { stroke: var(--steel-350); stroke-width: 1; }
#view .bore { fill: var(--surface-2); stroke: var(--steel-400); stroke-width: .8; }
#view .piston { fill: var(--steel-750); }
/* dark: the piston stays the darkest-reading steel part, not a bright block */
@media screen and (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #view .piston { fill: color-mix(in srgb, var(--steel-750) 55%, var(--surface)); } }
@media screen { :root[data-theme="dark"] #view .piston { fill: color-mix(in srgb, var(--steel-750) 55%, var(--surface)); } }
#view .seal { fill: var(--steel-550); }
#view .rod { stroke: var(--steel-600); stroke-width: 1; }
#view .block { fill: var(--steel-250); stroke: var(--steel-700); stroke-width: 1; }
#view .brk { fill: none; stroke: var(--steel-700); stroke-width: 1.1; stroke-linejoin: round; }
#view .brkfill { fill: var(--surface); }
#view .rail { fill: var(--steel-150); stroke: var(--steel-550); stroke-width: 1; }
#view .hatch { stroke: var(--steel-400); stroke-width: 1; }
#view .roller { fill: var(--surface); stroke: var(--steel-700); stroke-width: 1; }
#view .dimln { stroke: var(--steel-600); stroke-width: .9; }
/* valve, tubing, air */
#view .tube { fill: none; stroke: var(--faint); stroke-width: 3; stroke-linejoin: round; }
#view .flow { fill: none; stroke: var(--sel); stroke-width: 1.6; stroke-dasharray: 4 5; stroke-linejoin: round; animation: pnflow 1.6s linear infinite; }
@keyframes pnflow { to { stroke-dashoffset: -18; } }
@media (prefers-reduced-motion: reduce) { #view .flow { animation: none; } }
#view .valve { transition: transform .18s ease; }
#view .vbox { fill: var(--surface); stroke: var(--steel-700); stroke-width: 1.1; }
#view .varr { stroke: var(--steel-700); stroke-width: 1.1; }
#view .vblk { stroke: var(--steel-700); stroke-width: 1.1; fill: none; }
#view .sil { fill: var(--surface); stroke: var(--steel-700); stroke-dasharray: 2 1.5; }
#view .thr { fill: none; stroke: var(--steel-700); stroke-width: 1.1; }
#view .src { fill: var(--surface); stroke: var(--steel-700); }
#view .srcin { fill: var(--steel-700); }

.pn-live { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; min-height: 34px; align-items: center; }
.pn-live b { font-weight: 500; color: var(--text-3); margin-right: 4px; }
.pn-live i { font-style: normal; color: var(--text-3); }
.pn-live .clock { margin-left: auto; color: var(--sel); font-weight: 600; }
.stage-bar .btn.small { padding: 4px 10px; font-size: 12.5px; }
#play { min-width: 118px; background: var(--sel); border-color: var(--sel); color: var(--on-accent); font-weight: 600; }
#play:hover { filter: brightness(1.08); }
body.running #play { background: var(--surface); }
.pn-live .verdict-s { font-weight: 600; margin-right: 6px; }
.pn-live .verdict-s b { color: inherit; font-weight: 600; margin: 0; }
body.running #play { border-color: var(--sel); color: var(--sel); background: var(--surface); }
main.pn .stage-bar { justify-content: flex-start; gap: 8px; }
main.pn .stage { padding-left: 6px; padding-right: 6px; }
main.pn .stage-bar .hist { margin-left: auto; }
.pn-edit { position: absolute; transform: translate(-50%, -50%); z-index: 5; display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1.5px solid var(--sel); border-radius: 9px; padding: 2px 8px 2px 4px; box-shadow: 0 6px 18px rgba(20, 22, 28, .14); }
.pn-edit input { width: 82px; border: 0; outline: none; font: inherit; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; padding: 3px 2px; }
.pn-edit span { font-size: 11.5px; color: var(--text-3); }

/* examples */
.ex-wrap { position: relative; }

/* panel */
#panel input.bad { color: var(--bad); }
#panel .num:has(input.bad) { border-color: var(--bad); }
.mounts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin-bottom: 6px; }
.mount { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface, #fff); cursor: pointer; font: inherit; font-size: 12px; color: var(--text); text-align: left; }
.mount:hover { border-color: var(--line-2, #cfd2d6); }
.mount.on { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.mount b { font-weight: 500; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.duty { display: grid; gap: 2px; }
.duty .muted { color: var(--text-3); font-size: 11.5px; margin-left: 4px; }

/* summary: extend and retract side by side, four figures beside */
.pn-sum { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; }
.pn-motion { padding: 8px 20px 12px; min-width: 0; }
.pn-motion table { border-collapse: collapse; width: 100%; table-layout: fixed; }
.pn-motion thead th { padding: 6px 12px 8px 0; text-align: left; }
.pn-motion thead th:first-child { width: 150px; }
.pn-motion thead span { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.pn-motion tbody th { text-align: left; font-weight: 400; font-size: 12.5px; color: var(--text-3); padding: 6px 0; border-top: 1px solid var(--fill-1); white-space: nowrap; }
.pn-motion td { padding: 6px 12px 6px 0; border-top: 1px solid var(--fill-1); font-size: 13.5px; color: var(--text); font-variant-numeric: tabular-nums; }
.pn-motion td .muted { color: var(--text-3); font-size: 12px; }
.pn-mini { display: grid; grid-template-columns: repeat(2, minmax(150px, 1fr)); border-left: 1px solid var(--line); }
.pn-mini .stat { border-left: 0; border-top: 1px solid var(--line); }
.pn-mini .stat:nth-child(-n+2) { border-top: 0; }
.pn-mini .stat:nth-child(even) { border-left: 1px solid var(--line); }
@media (max-width: 1320px) {
  .pn-sum { grid-template-columns: minmax(0, 1fr); }
  .pn-mini { grid-template-columns: repeat(4, minmax(0, 1fr)); border-left: 0; border-top: 1px solid var(--line); }
  .pn-mini .stat { border-top: 0; border-left: 1px solid var(--line); }
  .pn-mini .stat:first-child { border-left: 0; }
}
@media (max-width: 700px) {
  .pn-mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pn-mini .stat:nth-child(3) { border-left: 0; }
  .pn-mini .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .pn-motion { padding: 6px 14px 12px; }
  .pn-motion thead th:first-child { width: 112px; }
  .pn-motion tbody th { font-size: 12px; white-space: normal; }
  .pn-motion td { font-size: 12.5px; }
}

/* margins table: 46 × 46 icons, preview cards */
table.pnms td.chk .cw { display: flex; align-items: center; gap: 10px; }
table.pnms td.chk .ic { flex: none; width: 46px; height: 46px; margin: -8px 0; }
table.pnms td.chk:focus-visible { outline: 2px solid var(--sel); outline-offset: -2px; border-radius: 6px; }
#checks tr[data-check] { cursor: pointer; }
#checks tr.sel td { background: var(--sel-bg); }
@media (max-width: 700px) { .pn-det { display: none; } table.pnms td.chk span { white-space: normal; }
}
@media (max-width: 480px) { .pn-alw { display: none; } table.pnms td.chk .ic { width: 34px; height: 34px; margin: -4px 0; } }
.pn-pv { position: fixed; z-index: 60; width: 220px; padding: 8px 8px 9px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px rgba(20, 24, 30, .14); pointer-events: none; font-size: 12px; color: var(--text); }
.pn-pv[hidden] { display: none; }
.pn-pv svg { display: block; width: 204px; height: auto; margin: 4px 0 6px; }
.pn-pv .pv-h { font-weight: 600; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn-pv .pv-c { color: var(--text-2); line-height: 1.35; }
.pn-pv .pv-m { margin-top: 4px; color: var(--text-3); }
@media print { .pn-pv { display: none !important; } }

/* charts */
#ptChart, #spChart { touch-action: none; user-select: none; }
#ptChart { cursor: ew-resize; }
#spChart .drag { cursor: ew-resize; }
.ch-t { font-size: 10.5px; fill: var(--text-3); font-variant-numeric: tabular-nums; }
.ch-a { font-size: 11px; fill: var(--text-2); }
.ch-l { font-size: 11px; font-weight: 600; }
.pn-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .pn-row { grid-template-columns: minmax(0, 1fr); } }

/* air per cycle */
#airBox { padding: 4px 2px 0; }
.air-total { font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.air-total b { font-size: 22px; font-weight: 600; color: var(--text); margin-right: 6px; font-variant-numeric: tabular-nums; }
.air-bar { display: flex; height: 16px; border-radius: 5px; overflow: hidden; background: var(--fill-1); margin-bottom: 12px; }
.air-bar i { display: block; height: 100%; }
.air-bar i + i { box-shadow: inset 1px 0 0 var(--surface); }
.air-leg { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.air-leg li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 44px; gap: 10px; align-items: center; font-size: 12.5px; color: var(--text-2); }
.air-leg .sw { width: 12px; height: 12px; border-radius: 3px; }
.air-leg b { font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.air-leg .pc { color: var(--text-3); text-align: right; font-variant-numeric: tabular-nums; }
.air-comp { font-size: 13px; color: var(--text-2); padding: 10px 12px; background: var(--bg); border-radius: 8px; }
.air-comp b { color: var(--text); font-weight: 600; }

/* reserve the space the script fills */
main.pn .summary { min-height: 236px; }
@media (max-width: 1040px) {
  main.pn .work { display: contents; }
  main.pn > * { order: 3; }
  main.pn .stage { order: 0; }
  main.pn .summary { order: 1; min-height: 0; }
  main.pn .panel { order: 2; }
}
.air-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
.air-flow div { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: grid; gap: 2px; }
.air-flow span { font-size: 11.5px; color: var(--text-3); }
.air-flow b { font-size: 14px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .air-flow { grid-template-columns: minmax(0, 1fr); } }
/* panel labels wrap to a second line instead of ending in an ellipsis (T029 QA) */
.f > label span { overflow: visible; text-overflow: clip; white-space: normal; line-height: 1.3; }

/* theme-auto:start · generated by scripts/theme/hexmap.py: dark values (the rule of scripts/theme/colour.py) for
   colours that are not tokens, written as var(--x-rrggbb, #rrggbb): light is the fallback, unchanged */
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --x-1e4fbf: #749ff5; --x-4f5862: #929aa3; --x-6e7177: #85827f; --x-7b848c: #6e767c; --x-93b4f3: #b2ccfe;
    --x-cdd2d7: #3e3c39; --x-cfd4d9: #3d3b38; --x-f0b48e: #e6b596;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --x-1e4fbf: #749ff5; --x-4f5862: #929aa3; --x-6e7177: #85827f; --x-7b848c: #6e767c; --x-93b4f3: #b2ccfe;
    --x-cdd2d7: #3e3c39; --x-cfd4d9: #3d3b38; --x-f0b48e: #e6b596;
  }
}
/* theme-auto:end */
