/* Exercise-only presentation. Equipment and course editors keep their current styles. */
.ct-plc{--ctp-ink:#143247;--ctp-muted:#526575;--ctp-line:#d6e1e8;color:var(--ctp-ink);padding:clamp(12px,2.5vw,28px);background:#fff;border:1px solid var(--ctp-line);border-radius:20px;box-shadow:0 12px 35px #102c4210;min-width:0;scroll-margin-top:100px}
.ct-plc *{box-sizing:border-box}.ct-plc [hidden]{display:none!important}
.ct-plc h2,.ct-plc h3,.ct-plc p{margin:0 0 10px}.ct-plc p{line-height:1.6}
.ctp-heading,.ctp-bench-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;flex-wrap:wrap}
.ctp-eyebrow{font-size:11px;font-weight:750;letter-spacing:.15em;color:#18627c}.ctp-heading h2{font-size:clamp(21px,3vw,29px);font-weight:650;letter-spacing:-.03em}.ctp-save{font-size:12px;color:var(--ctp-muted)}
.ctp-projects{display:flex;gap:8px;flex-wrap:wrap;margin:18px 0}.ctp-projects a{padding:12px 16px;min-height:44px;border:1px solid var(--ctp-line);border-radius:10px;text-decoration:none;color:var(--ctp-ink);font-size:14px;font-weight:600}.ctp-projects a[aria-current]{background:#112f45;color:white;border-color:#112f45}.ctp-projects span{font-size:12px}
.ctp-brief{background:#f3f7fa;border:1px solid #e0e9ef;padding:18px;border-radius:12px;margin-bottom:18px}.ctp-brief summary{cursor:pointer;min-height:44px;display:list-item;padding:10px 0;color:#175d77;font-weight:650}.ctp-brief details p{font-size:14px;color:#415a6b}.ctp-brief details p:first-of-type{margin-top:8px}
.ct-plc .ctp-actions{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px}
.ct-plc .ctp-actions button,.ct-plc .ctp-bench button:not(.ctp-push),.ct-plc #ctpTest{font:600 14px/1.3 system-ui,sans-serif;min-height:44px;padding:11px 16px;border:1px solid #b9cdd9;border-radius:9px;background:white;color:#163b53;cursor:pointer;white-space:normal}
.ct-plc #checkLadder,.ct-plc #ctpTest{background:#155d79;color:#fff;border-color:#155d79}.ct-plc button:disabled{opacity:.55;cursor:default}
.ct-plc :is(button,a,select,input,[tabindex]):focus-visible{outline:3px solid #00b8e5!important;outline-offset:3px}
.ct-plc .s5k{min-width:0;overflow:hidden;border-radius:12px;box-shadow:none}
.ct-plc .s5k-title{padding:12px;flex-wrap:wrap;gap:8px}.ct-plc .s5k-tname{font-size:16px;letter-spacing:-.025em}.ct-plc .s5k-proj{font:12px system-ui;overflow-wrap:anywhere;white-space:normal}
.ct-plc .s5k-fs,.ct-plc .s5k-dl,.ct-plc .s5k-run{min-height:44px;padding:10px 12px;font-size:14px;display:inline-flex;align-items:center;justify-content:center}
.ct-plc .s5k-online{padding:10px;gap:8px}.ctp-sim-label{color:#aec2d0;font:12px system-ui;margin-left:auto}
.ct-plc .s5k-body{display:grid;grid-template-columns:150px minmax(0,1fr);min-width:0}
.ct-plc .s5k-org{width:auto;min-width:0;font-size:11px;overflow:auto;max-height:500px}.ct-plc .s5k-rt-b{display:inline-block;padding:10px 0;min-height:44px;overflow-wrap:anywhere}
.ct-plc .s5k-rungs{min-width:0;max-height:650px;overflow:auto;overscroll-behavior-x:contain;touch-action:pan-x pan-y pinch-zoom}
.ct-plc .s5k-tags{grid-column:1/-1;max-height:230px;overflow:auto;width:auto;min-width:0;border-radius:0;margin:0;padding:12px}
.ct-plc .s5k-tags summary{min-height:44px;cursor:pointer;display:list-item;padding:12px 0}.ct-plc .ai-tag-row{grid-template-columns:minmax(90px,150px) 30px minmax(100px,1fr);gap:8px;font-size:12px}.ct-plc .ai-tag-row b{font-size:12px;overflow-wrap:anywhere}.ct-plc .ai-tag-desc{font-size:12px}
.ct-plc .s5k-ins{min-width:54px;min-height:48px}.ct-plc .s5k-tabs{display:none}
.ct-plc #ladderEditor.ai-ladder{padding:0 14px 12px;overflow:visible;border:0;min-width:max-content;border-radius:0}
.ct-plc .ai-routine-head{padding:14px 4px;flex-wrap:wrap}.ct-plc .ai-routine-head em{font-size:12px}
.ct-plc .ai-rung-cmt{white-space:normal;max-width:660px;padding:12px 8px;line-height:1.5;font-size:12px}.ct-plc .ai-rung-hint{font-size:12px;line-height:1.5}.ct-plc .ai-rung-ok{display:none}
.ct-plc #ladderEditor .ai-rung-line{gap:28px;padding-left:22px;padding-right:30px;min-height:150px;flex-wrap:nowrap}
.ct-plc #ladderEditor .s5k-cell{min-width:130px;width:130px;flex-shrink:0;overflow:visible}
.ct-plc #ladderEditor .s5k-cell select.s5k-tagin{width:132px;min-height:44px;font-size:16px;padding:8px 4px;background:#142b3a;appearance:auto;border:1px solid #577b94;border-radius:5px;bottom:calc(100% + 6px);margin:0}
.ct-plc #ladderEditor .s5k-cell .s5k-typesel{display:block!important;width:132px;min-height:44px;font-size:16px;padding:8px 4px;background:#142b3a;appearance:auto;border:1px solid #577b94;border-radius:5px;top:calc(100% + 6px);margin:0}
.ct-plc #ladderEditor .s5k-cell.empty{height:32px;font-size:18px}
.ct-plc #ladderEditor .ai-coil{min-width:125px}.ct-plc #ladderEditor .ai-coil .ai-c-tag{font-size:14px;line-height:1.3;margin-bottom:14px;white-space:nowrap}
/* Keep branch geometry stable whether or not a cell has focus. Two 44px selectors
   fit around each symbol without touching the next branch leg or rung. */
.ct-plc #ladderEditor .ai-rung.ai-rung-branch,.ct-plc #ladderEditor .ai-rung.ai-rung-branch:has(.s5k-cell.sel){--l9hang:160px;min-height:340px}
.ct-plc #ladderEditor .ai-rung.ai-rung-branch>.ai-rung-line{padding-bottom:160px}
.ct-plc #ladderEditor .ai-rung.ai-rung-branch>.ai-rung-line::before{top:calc(50% - 80px)}
.ct-plc #ladderEditor .ai-rung.ai-rung-branch .ai-branch-row:not(:first-child){top:calc(100% + 108px)}
.ct-plc #ladderEditor .ai-rung.ai-rung-branch .ai-branch::before,.ct-plc #ladderEditor .ai-rung.ai-rung-branch .ai-branch::after{height:160px}
.ct-plc #ladderEditor .ai-branch-row:not(:first-child) .s5k-tagin{bottom:calc(100% + 6px);margin:0}
.ct-plc .s5k-statusbar{padding:10px;gap:8px;flex-wrap:wrap;white-space:normal;font-size:12px;line-height:1.5;flex-shrink:0}.ct-plc #s5kStatusMsg{flex:1 1 300px}.ct-plc #s5kScan{white-space:nowrap}
.ct-plc .s5k-output-h{gap:12px;flex-wrap:wrap;padding:10px}.ct-plc #s5kOutputX{margin-left:auto;min-width:44px;min-height:44px}.ct-plc .s5k-out-row{display:flex;flex-direction:column;gap:5px;font-size:13px;line-height:1.5}
.ct-plc .fv-modal{z-index:12000;padding:12px}.ct-plc .fv-dlg{width:500px;max-height:90dvh;overflow:auto;font-size:15px;border-radius:12px}.ct-plc .fv-dlg-body{line-height:1.6;padding:18px}.ct-plc .fv-dlg-title{font-size:16px;padding:14px}.ct-plc .fv-dlg-foot{flex-wrap:wrap;padding:14px}.ct-plc .fv-dlg-foot button{min-height:44px;font-size:14px;padding:10px 14px}
.ctp-bench{margin-top:24px;border:1px solid var(--ctp-line);border-radius:12px;padding:18px;background:#f6f9fb}.ctp-bench h3{font-size:20px}.ctp-bench p{font-size:14px;color:var(--ctp-muted)}.ctp-inputs{display:flex;gap:12px;flex-wrap:wrap;margin:18px 0}.ctp-input{flex:1 1 135px;max-width:230px;min-width:0}
.ct-plc .ctp-push{width:100%;display:flex;flex-direction:column;align-items:center;gap:8px;border:1px solid #c8d9e3;border-radius:12px;background:white;padding:14px 8px;color:#15394f;cursor:pointer;touch-action:manipulation;user-select:none;-webkit-user-select:none}
.ct-plc .ctp-push[aria-pressed=true]{background:#e2f2f7;box-shadow:inset 0 0 0 2px #127591}.ctp-push img{width:72px;height:82px;object-fit:contain;pointer-events:none}.ctp-push strong{font-size:14px}.ctp-push code{font-size:12px;overflow-wrap:anywhere}.ctp-hold{display:flex;align-items:center;justify-content:center;gap:8px;min-height:48px;font-size:13px;cursor:pointer}.ctp-hold input{width:20px;height:20px;accent-color:#155d79}
.ctp-outputs{display:flex;flex-wrap:wrap;gap:24px;padding:18px 0;border-top:1px solid var(--ctp-line)}.ctp-lamp{display:flex;flex-direction:column;align-items:center;gap:5px;min-width:80px}.ctp-lamp img{object-fit:contain}.ctp-lamp strong{font-size:14px}.ctp-lamp span{font:12px ui-monospace,monospace}
.ctp-testbar{display:flex;gap:18px;align-items:center;flex-wrap:wrap;margin-top:20px}.ctp-testbar p{flex:1 1 220px;color:var(--ctp-muted);font-size:13px;margin:0}.ctp-results{margin-top:18px}.ctp-results:empty{display:none}.ctp-results h3{font-size:19px}.ctp-results ul{padding:0;margin:0;list-style:none;display:grid;gap:8px}.ctp-results li{padding:12px;border:1px solid var(--ctp-line);border-radius:8px;font-size:14px;line-height:1.5}.ctp-results li span{display:block;margin-top:5px}.ctp-pass{background:#eff8f3;color:#1b6546}.ctp-fail{background:#fff5ee;color:#8c401a}.ctp-next a{display:inline-flex;padding:14px 0;min-height:44px;color:#155d79;font-weight:650}
@media(max-width:900px){.ct-plc .s5k-body{grid-template-columns:minmax(0,1fr)}.ct-plc .s5k-org{display:none}.ct-plc .s5k-tags{max-height:190px}.ct-plc .s5k.s5k-max .s5k-body{overflow:auto;display:block}.ct-plc .s5k.s5k-max .s5k-rungs{max-height:65dvh}.ct-plc .s5k.s5k-max .s5k-tags{max-height:190px}}
@media(max-width:480px){.ct-plc{padding:10px;border-radius:12px}.ctp-projects{display:grid;grid-template-columns:1fr 1fr;gap:6px}.ctp-projects a{padding:10px;font-size:12px}.ctp-projects span{display:block}.ctp-brief,.ctp-bench{padding:12px}.ctp-sim-label{width:100%;margin-left:0}.ctp-input{flex-basis:100px}.ct-plc .s5k-statusbar{font-size:11px}.ct-plc .ai-tag-row{grid-template-columns:minmax(80px,1fr) 24px}.ct-plc .ai-tag-desc{grid-column:1/-1}.ct-plc .ctp-actions button{flex:1 1 auto}.ct-plc .s5k-title{padding:10px}.ct-plc .s5k-tname{font-size:14px}.ct-plc .s5k-proj{display:none}}
@media(prefers-reduced-motion:reduce){.ct-plc *{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
