/* Controls workspace (controls_page.js): Stop, the on-screen remote and, out of the way, the Emergency stop. */
body.controls-view .app-shell>main,body.controls-view #performance-page,body.controls-view #interactive-page,body.controls-view #destination-controls,body.controls-view #help-button,body.controls-view #details-toggle{display:none!important}
body.controls-view .app-shell .topbar.has-destination-controls{height:var(--toolbar);min-height:var(--toolbar);flex-basis:var(--toolbar)}
body.controls-view .has-destination-controls .top-actions{grid-column:2}
.controls-page{width:100%;max-width:940px;margin:0 auto;padding:22px 12px 28px;min-height:0;flex:1;overflow:auto;scrollbar-gutter:stable;color:var(--label)}

.ct-header{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:16px}
.ct-header h1{font-size:24px;letter-spacing:-.6px;font-weight:650;line-height:1.2;outline:none}
.ct-header p{font-size:13px;margin-top:3px;color:var(--label-2)}
.ct-pill{flex:none;display:inline-flex;align-items:center;height:26px;padding:0 11px;border-radius:13px;font-size:12px;font-weight:650;background:var(--fill-2);color:var(--label-2)}
.ct-pill[data-destination=robot]{background:var(--live-wash);color:var(--live);box-shadow:inset 0 0 0 1px var(--live-line)}
.ct-pill[data-destination=simulator]{background:var(--sim-wash);color:var(--sim);box-shadow:inset 0 0 0 1px var(--sim-line)}
.ct-note{min-height:18px;font-size:12.5px;color:var(--label-2)}

/* Stop: the biggest thing on the page. */
.ct-stop{display:flex;align-items:center;justify-content:center;gap:16px;width:100%;min-height:78px;padding:12px 20px;border:0;border-radius:20px;background:var(--red-fill);color:#fff;box-shadow:0 1px 2px rgba(0,0,0,.08),0 8px 24px rgba(224,48,30,.22);transition:transform .12s ease,filter .12s ease}
.ct-stop:hover{filter:brightness(1.05)}
.ct-stop:active{transform:scale(.985);filter:brightness(.95)}
.ct-stop:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
.ct-stop>span:last-child{display:flex;flex-direction:column;align-items:flex-start;text-align:left}
.ct-stop strong{font-size:24px;font-weight:700;letter-spacing:-.4px;line-height:1.1}
.ct-stop small{font-size:12.5px;opacity:.9;margin-top:2px}
.ct-stop-mark{width:26px;height:26px;border-radius:6px;background:#fff;flex:none}
#ct-stop-note{margin:6px 4px 14px}

/* The remote. */
.ct-remote{background:var(--surface);border-radius:var(--radius-card);box-shadow:var(--shadow-card);padding:18px 14px 14px}
.ct-shoulders{display:flex;justify-content:space-between;gap:12px}
.ct-shoulders>div{display:flex;gap:8px}
.ct-key{border:0;border-radius:12px;background:var(--fill-2);color:var(--label);font-size:14px;font-weight:650;min-width:58px;height:38px;padding:0 12px;touch-action:none;user-select:none;-webkit-user-select:none;transition:background .1s ease,color .1s ease,transform .08s ease}
.ct-key:hover:not(:disabled){background:var(--hover)}
.ct-key:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.ct-key:disabled{opacity:.4}
.ct-key.is-armed{background:var(--accent-wash);color:var(--accent-text);box-shadow:inset 0 0 0 1.5px var(--accent)}
.ct-key.is-held{background:var(--accent);color:#fff;transform:scale(.96)}
.ct-pads{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:16px;margin:16px 0 6px}
.ct-dpad,.ct-face{display:grid;grid-template:repeat(3,44px)/repeat(3,44px);gap:2px}
.ct-dpad .ct-key,.ct-face .ct-key{min-width:0;width:44px;height:44px;padding:0;border-radius:50%}
.ct-dpad .ct-key{border-radius:11px;font-size:12px}
.ct-up{grid-area:1/2}.ct-left{grid-area:2/1}.ct-right{grid-area:2/3}.ct-down{grid-area:3/2}
.ct-centre{display:grid;grid-template-columns:repeat(2,auto);justify-content:center;gap:8px}
.ct-key.ct-small{min-width:64px;height:32px;font-size:12px;border-radius:16px}
.ct-sticks{display:flex;justify-content:space-around;gap:16px;margin:10px 0 4px;padding-bottom:22px}
.ct-stick{position:relative;width:204px;height:204px;border-radius:50%;background:var(--fill-2);box-shadow:inset 0 2px 8px rgba(0,0,0,.08);touch-action:none;cursor:grab;flex:none}
.ct-stick:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.ct-stick.is-active{cursor:grabbing;background:var(--accent-wash)}
.ct-stick.is-disabled{opacity:.45;cursor:default}
.ct-stick-turn::before{content:"";position:absolute;left:12%;right:12%;top:50%;height:6px;margin-top:-3px;border-radius:3px;background:var(--separator)}
.ct-knob{position:absolute;z-index:1;left:28%;top:28%;width:44%;height:44%;border-radius:50%;background:var(--surface);box-shadow:0 1px 2px rgba(0,0,0,.12),0 4px 14px rgba(0,0,0,.14);pointer-events:none}
.ct-stick:not(.is-active) .ct-knob{transition:transform .14s ease-out}
.ct-stick>span{position:absolute;left:0;right:0;bottom:-22px;text-align:center;font-size:12px;font-weight:600;color:var(--label-3)}
#ct-remote-note{text-align:center;margin-top:4px}

/* Walk: a cross for its two ways (never diagonal); the turn stick has its one bar. */
.ct-stick-walk::before,.ct-stick-walk::after{content:"";position:absolute;border-radius:3px;background:var(--separator)}
.ct-stick-walk::before{left:12%;right:12%;top:50%;height:6px;margin-top:-3px}
.ct-stick-walk::after{top:12%;bottom:12%;left:50%;width:6px;margin-left:-3px}
.ct-stick-hint{margin:8px 0 0;text-align:center;font-size:11.5px;color:var(--label-3)}
/* The throw: a ring round the touch, full speed at its edge, while the stick is held. */
.ct-throw{position:absolute;z-index:2;transform:translate(-50%,-50%);border-radius:50%;border:2px dashed var(--accent);opacity:0;pointer-events:none;transition:opacity .12s ease}
.ct-stick.is-active .ct-throw{opacity:.55}
/* Expo & throw: a small button under the sticks; open, each stick's curve with its live position and tuning. */
.ct-expo-bar{display:flex;justify-content:center;margin-top:10px}
.ct-expo-toggle{border:0;border-radius:13px;height:26px;padding:0 12px;background:var(--fill-2);color:var(--label-2);font-size:12px;font-weight:650}
.ct-expo-toggle:hover{background:var(--hover)}
.ct-expo-toggle[aria-expanded=true]{background:var(--accent-wash);color:var(--accent-text)}
.ct-expo-toggle:focus-visible,.ct-expo-reset:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.ct-expo{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:10px}
.ct-expo[hidden]{display:none}
.ct-curve{background:var(--fill-2);border-radius:14px;padding:10px 12px 8px;min-width:0}
.ct-curve-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px;font-size:13px}
.ct-curve-half{font-size:11.5px;color:var(--label-3);font-variant-numeric:tabular-nums}
.ct-curve svg{display:block;width:100%;height:120px;margin:8px 0 2px;overflow:visible}
.ct-curve-grid{fill:none;stroke:var(--hairline);stroke-width:.6;vector-effect:non-scaling-stroke}
.ct-curve-linear{fill:none;stroke:var(--separator);stroke-width:1;stroke-dasharray:3 3;vector-effect:non-scaling-stroke}
.ct-curve-dead{fill:color-mix(in srgb,var(--label) 7%,transparent);stroke:none}
.ct-curve-line{fill:none;stroke:var(--accent);stroke-width:2.2;stroke-linejoin:round;vector-effect:non-scaling-stroke}
.ct-curve-dot{fill:none;stroke:var(--accent);stroke-width:10;stroke-linecap:round;vector-effect:non-scaling-stroke;opacity:0;transition:opacity .12s ease}
.ct-curve-dot.is-live{opacity:1}
.ct-curve-axes{display:flex;justify-content:space-between;font-size:10.5px;color:var(--label-3);margin-bottom:4px}
.ct-curve label{display:grid;grid-template-columns:78px minmax(0,1fr) 38px;align-items:center;gap:8px;font-size:12px;color:var(--label-2);height:28px}
.ct-curve input[type=range]{width:100%;accent-color:var(--accent)}
.ct-curve output{text-align:right;font-variant-numeric:tabular-nums;color:var(--label)}
.ct-expo-foot{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:11.5px;color:var(--label-3)}
.ct-expo-reset{flex:none;border:0;background:none;color:var(--accent-text);font-size:12px;font-weight:600;padding:4px 2px}

/* Shortcuts: the remote card's key combos always on show, beside the remote in a wide window, below it
   otherwise; the rest of the card on request. */
.ct-body{display:grid;grid-template-columns:minmax(0,1fr);gap:14px}
.ct-shortcuts{background:var(--surface);border-radius:var(--radius-card);box-shadow:var(--shadow-card);padding:14px 18px 12px;align-self:start}
.ct-shortcuts h2{font-size:15px;font-weight:650;letter-spacing:-.2px;margin-bottom:4px}
.ct-shortcuts h2 span{font-weight:500;font-size:12px;color:var(--label-3);margin-left:6px}
.ct-card-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 0;border-top:1px solid var(--hairline)}
#ct-key-rows .ct-card-row:first-child{border-top:0}
.ct-card-label{display:flex;flex-direction:column;min-width:0;font-size:13px}
.ct-card-title{font-weight:600}
.ct-card-label small{font-size:11.5px;color:var(--label-3);margin-top:1px}
.ct-card-sends{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:6px;flex:none;max-width:60%}
.ct-chip{border:0;border-radius:13px;height:26px;padding:0 10px;background:var(--fill-2);color:var(--label);font-size:12px;font-weight:650;white-space:nowrap;font-variant-numeric:tabular-nums}
button.ct-chip:hover:not(:disabled){background:var(--accent-wash);color:var(--accent-text)}
button.ct-chip:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.ct-chip:disabled{opacity:.45}
.ct-chip.ct-walk{background:var(--accent);color:#fff}
button.ct-chip.ct-walk:hover:not(:disabled){background:var(--accent-text);color:#fff}
.ct-chip.ct-walk.is-armed,button.ct-chip.ct-walk.is-armed:hover:not(:disabled){background:#ff9f0a;color:#fff;box-shadow:0 0 0 3px rgba(255,159,10,.28)}
.ct-chip.is-static{display:inline-flex;align-items:center;background:transparent;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--red) 40%,transparent);color:var(--red)}
.ct-chip.is-on,button.ct-chip.is-on:hover:not(:disabled){background:var(--accent);color:#fff}
.ct-by-hand{font-size:11px;color:var(--label-3)}
.ct-shortcut-hint{font-size:12px;color:var(--label-2);padding:8px 0 2px;border-top:1px solid var(--hairline)}
.ct-cap{display:inline-flex;align-items:center;height:20px;padding:0 7px;margin-right:4px;border-radius:10px;background:var(--fill-2);font-size:11.5px;font-weight:650}
.ct-card-list{margin-top:6px;border-top:1px solid var(--hairline)}
.ct-card-list summary{cursor:pointer;padding:10px 0 4px;font-size:13px;font-weight:600;color:var(--accent-text)}
.ct-card-list summary:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:6px}
.ct-card-group{font-size:11px;font-weight:650;text-transform:uppercase;letter-spacing:.5px;color:var(--label-3);margin:12px 0 2px}
@media(min-width:1180px){
  .controls-page{max-width:1320px}
  .ct-body{grid-template-columns:minmax(0,1fr) 360px;align-items:start}
  .ct-shortcuts{position:sticky;top:0;max-height:calc(100vh - var(--toolbar) - 40px);overflow:auto}
}

/* Emergency stop: at the bottom, quiet until it is needed, and two taps. */
/* Controls › Hand guide (hand_guide_controls.js), under the remote */
.ct-guide{margin-top:14px}
.ct-emergency{display:flex;align-items:center;justify-content:flex-end;gap:14px;margin-top:28px}
.ct-emergency .ct-note{text-align:right}
.ct-damp{display:flex;flex-direction:column;align-items:flex-start;flex:none;border:1px solid color-mix(in srgb,var(--red) 45%,transparent);border-radius:12px;background:var(--surface);color:var(--red);padding:7px 14px;text-align:left;transition:background .12s ease,color .12s ease}
.ct-damp strong{font-size:13px;font-weight:650}
.ct-damp small{font-size:11px;opacity:.85}
.ct-damp:hover:not(:disabled){background:var(--red-wash)}
.ct-damp:disabled{opacity:.4}
.ct-damp.is-armed{background:var(--red);border-color:var(--red);color:#fff}
.ct-damp:focus-visible{outline:2px solid var(--red);outline-offset:2px}

@media(max-width:640px){
  .controls-page{padding:14px 8px 20px;scrollbar-gutter:auto}
  .ct-header{align-items:flex-start;margin-bottom:12px}
  .ct-header h1{font-size:22px}
  .ct-stop{min-height:70px}
  .ct-remote{padding:14px 10px 10px}
  .ct-key{min-width:52px;height:40px}
  .ct-pads{grid-template-columns:1fr 1fr;grid-template-areas:"dpad face" "centre centre";justify-items:center;gap:12px}
  .ct-dpad{grid-area:dpad}.ct-face{grid-area:face}.ct-centre{grid-area:centre;grid-template-columns:repeat(4,auto)}
  .ct-key.ct-small{min-width:0;padding:0 12px}
  .ct-sticks{gap:10px}
  .ct-expo{grid-template-columns:minmax(0,1fr)}
  .ct-stick{width:min(43vw,170px);height:min(43vw,170px)}
  .ct-shortcuts{padding:12px 12px 10px}
  .ct-card-sends{max-width:55%}
  .ct-emergency{flex-direction:column-reverse;align-items:stretch}
  .ct-emergency .ct-note{text-align:left}
}
@media(prefers-reduced-motion:reduce){.controls-page *{transition:none!important}}

/* Linker hands hot or closed too long (19 Oct 2026). */
#ct-where.is-warning{color:var(--orange);font-weight:600}
