/* Smooth press-and-slide on the existing (not full-width) mobile matrix,
   and the same behaviour in the full-screen overlay. Desktop layout is unchanged. */

.tool-fs-hint, .tool-fs-btn, .co-fit-badge { touch-action: manipulation; -webkit-tap-highlight-color: rgba(29,78,216,.25); }

@media (max-width: 800px) {
  #factoryops-changeover-stage .tool-fs-hint {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    box-sizing: border-box; width: 100%; min-height: 48px; margin: 0 0 6px; padding: 0 12px;
    font: 700 11px/1.2 "JetBrains Mono", monospace; letter-spacing: .04em; text-transform: uppercase; text-align: left;
    color: #111; background: #f5f6f7; border: 1px solid #111; border-radius: 2px; cursor: pointer;
  }
  #factoryops-changeover-stage .tool-fs-hint:active { background: #60A5FA; }
  #factoryops-changeover-stage .tool-fs-hint:focus-visible { outline: 2px solid #1D4ED8; outline-offset: 2px; }
  #factoryops-changeover-stage .tool-fs-hint svg { flex-shrink: 0; }
  #changeover #factoryops-changeover-stage:not(.is-fs-open):not(.is-fs-fallback) .co-map-toolbar .tool-fs-btn {
    min-height: 44px; padding: 0 16px; font-size: 11px;
  }
  #changeover #factoryops-changeover-stage:not(.is-fs-open):not(.is-fs-fallback) .co-map-toolbar { min-height: 44px; }

  /* A drag on a cell slides the selection, not the page. Page / matrix scroll still starts on labels and everything outside the cells. */
  #factoryops-changeover-stage:not(.is-fs-open):not(.is-fs-fallback) .co-cell {
    touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  }
}

/* Full-screen cells already sit under the zoom viewport (touch-action: none there). Keep selection from selecting text. */
#factoryops-changeover-stage.is-fs-open .co-cell,
#factoryops-changeover-stage.is-fs-fallback .co-cell {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}

#factoryops-changeover-stage.is-tracing .co-matrix { outline: 2px solid #1D4ED8; outline-offset: -2px; }
.co-trace-readout { top: auto; } /* position is set in JS so it can follow the finger */

/* Helix-9 SOP homepage card: same shell as the changeover card */
.helix9-feature {
  display: flex; flex-direction: column; gap: 16px;
  margin: 0 0 16px; max-width: 100%; min-width: 0;
}
.helix9-card { margin: 0; }
.helix9-card .tool-stage { padding-bottom: 8px; }
.helix9-card #factoryops-helix9-stage .tool-fs-controls { position: static; top: auto; right: auto; }
.helix9-card #factoryops-helix9-stage .tool-fs-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 16px; text-decoration: none;
}
@media (max-width: 800px) {
  .helix9-card #factoryops-helix9-stage .tool-fs-controls { margin: 0 0 8px; }
}
